mirror of
https://github.com/friendica/friendica
synced 2025-04-27 04:30:11 +00:00
Performance stuff: Caching for getsiteinfo function, check before running onepoll.php
This commit is contained in:
parent
2ac42036fb
commit
4fb059095f
3 changed files with 26 additions and 13 deletions
|
@ -948,7 +948,12 @@ function add_page_info_data($data) {
|
|||
function add_page_info($url, $no_photos = false, $photo = "", $keywords = false, $keyword_blacklist = "") {
|
||||
require_once("mod/parse_url.php");
|
||||
|
||||
$data = parseurl_getsiteinfo($url, true);
|
||||
$data = Cache::get("parse_url:".$url);
|
||||
if (is_null($data)){
|
||||
$data = parseurl_getsiteinfo($url, true);
|
||||
Cache::set("parse_url:".$url,serialize($data));
|
||||
} else
|
||||
$data = unserialize($data);
|
||||
|
||||
if ($photo != "")
|
||||
$data["images"][0]["src"] = $photo;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue