Changeset 1454

Show
Ignore:
Timestamp:
02/17/10 12:01:25 (5 months ago)
Author:
arnoschn
Message:

disable action cache when we have flash messages, removing set-cookie header from page cache

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/AkActionController/AkCacheHandler.php

    r1453 r1454  
    646646        } 
    647647        foreach ($addHeaders as $type=>$val) { 
    648             $finalHeaders[] = $type.($val!==true?': '.$val:''); 
     648            if(strtolower($type)!='set-cookie') { 
     649                $finalHeaders[] = $type.($val!==true?': '.$val:''); 
     650            } 
    649651        } 
    650652        $timestamp = time(); 
     
    11301132            $this->_controller->Response->addHeader('X-Cached-By','Akelos-Action-Cache'); 
    11311133            $this->_controller->Response->setContentTypeForFormat($format); 
    1132         } else
     1134        } else if(empty($_SESSION['__flash']) && empty($this->_controller->flash_now))
    11331135            ob_start(); 
    11341136            $this->_rendered_action_cache = false; 
     1137        } else { 
     1138            $this->_dont_action_cache=true; 
    11351139        } 
    11361140        return true; 
     
    11391143    function afterActionCache() 
    11401144    { 
    1141         if (!$this->_cachingAllowed() || $this->_rendered_action_cache === true) return; 
     1145        if (!$this->_cachingAllowed() || $this->_rendered_action_cache === true || !empty($this->_dont_action_cache)) return; 
    11421146 
    11431147        $this->_controller->handleResponse();