Example #1
0
 public function getCacheHeaders(Page $c)
 {
     $lifetime = $c->getCollectionFullPageCachingLifetimeValue();
     $expires = gmdate('D, d M Y H:i:s', time() + $lifetime) . ' GMT';
     $headers = array('Pragma' => 'public', 'Cache-Control' => 'max-age=' . $lifetime . ',s-maxage=' . $lifetime, 'Expires' => $expires);
     return $headers;
 }
 public function set(ConcretePage $c, $content)
 {
     if (!is_dir(Config::get('concrete.cache.page.directory'))) {
         @mkdir(Config::get('concrete.cache.page.directory'));
         @touch(Config::get('concrete.cache.page.directory') . '/index.html');
     }
     $lifetime = $c->getCollectionFullPageCachingLifetimeValue();
     $file = $this->getCacheFile($c);
     if ($file) {
         $response = new PageCacheRecord($c, $content, $lifetime);
         if ($content) {
             file_put_contents($file, serialize($response));
         }
     }
 }
Example #3
0
 public function getCollectionFullPageCachingLifetimeValue()
 {
     return parent::getCollectionFullPageCachingLifetimeValue();
 }