cache thumbs for 24h instead of forever
This commit is contained in:
parent
33731e8cb0
commit
ec7f63ee1f
2 changed files with 9 additions and 3 deletions
|
@ -32,6 +32,12 @@ class RSSImages extends Extension
|
|||
}
|
||||
}
|
||||
|
||||
public function onImageInfoSet(ImageInfoSetEvent $event)
|
||||
{
|
||||
global $cache;
|
||||
$cache->delete("rss-item-image:{$event->image->id}");
|
||||
}
|
||||
|
||||
private function do_rss(array $images, array $search_terms, int $page_number)
|
||||
{
|
||||
global $page;
|
||||
|
@ -81,7 +87,7 @@ class RSSImages extends Extension
|
|||
{
|
||||
global $cache;
|
||||
|
||||
$cached = $cache->get("rss-thumb:{$image->id}");
|
||||
$cached = $cache->get("rss-item-image:{$image->id}");
|
||||
if ($cached) {
|
||||
return $cached;
|
||||
}
|
||||
|
@ -109,7 +115,7 @@ class RSSImages extends Extension
|
|||
</item>
|
||||
";
|
||||
|
||||
$cache->set("rss-thumb:{$image->id}", $data, 3600);
|
||||
$cache->set("rss-item-image:{$image->id}", $data, 86400);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ class Themelet extends BaseThemelet
|
|||
"</div>\n";
|
||||
|
||||
// cache for ages; will be cleared in ext/index:onImageInfoSet
|
||||
$cache->set("thumb-block:{$image->id}", $html, 0);
|
||||
$cache->set("thumb-block:{$image->id}", $html, 86400);
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
|
Reference in a new issue