]> git.mxchange.org Git - friendica.git/blobdiff - mod/item.php
Preloading of items in the cache when receiving them.
[friendica.git] / mod / item.php
index 7096239b0f9dcff6a53ab1cc659ca54dfc76ca0a..452ec8a36de917d90b8f18b194895793239782b6 100644 (file)
@@ -757,6 +757,15 @@ function item_post(&$a) {
                // update filetags in pconfig
                 file_tag_update_pconfig($uid,$categories_old,$categories_new,'category');
 
+               // Store the fresh generated item into the cache
+               $cachefile = get_cachefile($datarray["guid"]."-".hash("md5", $datarray['body']));
+
+               if (($cachefile != '') AND !file_exists($cachefile)) {
+                       $s = prepare_text($datarray['body']);
+                       file_put_contents($cachefile, $s);
+                       logger('mod_item: put item '.$r[0]['id'].' into cachefile '.$cachefile);
+               }
+
                if($parent) {
 
                        // This item is the last leaf and gets the comment box, clear any ancestors