To participate you must create an account on apostrophenow.org. If you have already done so, click Login.

Changeset 4541

Show
Ignore:
Timestamp:
02/03/12 15:55:26 (4 months ago)
Author:
tboutell
Message:

Don't cache non-200 OK responses, it leads to SEO problems

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • plugins/apostrophePlugin/branches/1.5/lib/sfFilter/aCacheFilter.class.php

    r4334 r4541  
    4242    { 
    4343      $filterChain->execute(); 
     44      // Never try to cache a 404 error. Later we might consider 
     45      // caching them but remembering their status properly so it  
     46      // doesn't magically become a 200 OK when returned from cache 
     47      if ($this->context->getResponse()->getStatusCode() !== 200) 
     48      { 
     49        return; 
     50      } 
    4451      $content = $this->context->getResponse()->getContent(); 
    4552      // Check whether aCacheInvalid was set for this user during the current request, don't cache