Preloading of items in the cache when receiving them.

This commit is contained in:
Michael Vogel 2013-01-17 23:20:40 +01:00
parent 452ff19d73
commit 82c00660e0
6 changed files with 38 additions and 10 deletions

View 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