]> git.mxchange.org Git - friendica.git/blobdiff - include/items.php
Performance stuff: Caching for getsiteinfo function, check before running onepoll.php
[friendica.git] / include / items.php
index bd1f48c5e3ba216b443faf168463a036229b7817..22ae2f60a718fcc2b6e23343af8e2b50a20fc746 100644 (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;