Increase cache ttl for handlebars templates

This commit is contained in:
Dmitriy Simushev 2014-10-14 11:16:55 +00:00
parent 3fbc5fa262
commit ae7ee06031

View File

@ -90,8 +90,12 @@ class CacheAdapter implements HandlebarsCacheInterface, CacheAwareInterface
public function set($name, $value) public function set($name, $value)
{ {
$item = $this->getCacheItem($name); $item = $this->getCacheItem($name);
// Cache templates for ten minutes // Cache templates for twelve hours. Actually we can use arbitrary value
$item->set($value, 10*60); // for cache ttl. Handlebars builds cache name according to template
// content, thus if template is changed another cache item will be used.
// At the same time ttl must be a finite value to allow garbage
// collector to remove unused cache items.
$item->set($value, 12 * 60 * 60);
} }
/** /**