Performance stuff: Caching for getsiteinfo function, check before running onepoll.php

This commit is contained in:
Michael Vogel 2014-12-21 02:03:06 +01:00
parent 2ac42036fb
commit 4fb059095f
3 changed files with 26 additions and 13 deletions

View file

@ -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;