Development

Changeset 7976

You must first sign up to be able to contribute.

Changeset 7976

Show
Ignore:
Timestamp:
03/19/08 17:35:53 (1 year ago)
Author:
fabien
Message:

fixed view cache doesn't accept zero client lifetime (closes #3141)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/lib/filter/sfCacheFilter.class.php

    r7770 r7976  
    112112    { 
    113113      // set some headers that deals with cache 
    114       $lifetime = $this->cacheManager->getClientLifeTime($uri, 'page'); 
    115       $this->response->setHttpHeader('Last-Modified', $this->response->getDate(time()), false); 
    116       $this->response->setHttpHeader('Expires', $this->response->getDate(time() + $lifetime), false); 
    117       $this->response->addCacheControlHttpHeader('max-age', $lifetime); 
     114      if ($lifetime = $this->cacheManager->getClientLifeTime($uri, 'page')) 
     115      { 
     116        $this->response->setHttpHeader('Last-Modified', $this->response->getDate(time()), false); 
     117        $this->response->setHttpHeader('Expires', $this->response->getDate(time() + $lifetime), false); 
     118        $this->response->addCacheControlHttpHeader('max-age', $lifetime); 
     119      } 
    118120 
    119121      // set Vary headers 
  • branches/1.1/lib/view/sfViewCacheManager.class.php

    r7787 r7976  
    242242      'withLayout'     => isset($options['withLayout']) ? $options['withLayout'] : false, 
    243243      'lifeTime'       => $options['lifeTime'], 
    244       'clientLifeTime' => isset($options['clientLifeTime']) && $options['clientLifeTime'] ? $options['clientLifeTime'] : $options['lifeTime'], 
     244      'clientLifeTime' => isset($options['clientLifeTime']) ? $options['clientLifeTime'] : $options['lifeTime'], 
    245245      'contextual'     => isset($options['contextual']) ? $options['contextual'] : false, 
    246246      'vary'           => isset($options['vary']) ? $options['vary'] : array(), 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.