[wp-trac] [WordPress Trac] #22258: nocache_headers fail to prevent aggressive caching in Chrome

WordPress Trac noreply at wordpress.org
Mon Oct 22 21:16:19 UTC 2012


#22258: nocache_headers fail to prevent aggressive caching in Chrome
-----------------------------+--------------------------
 Reporter:  andy             |       Type:  defect (bug)
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  General
  Version:  trunk            |   Severity:  normal
 Keywords:  has-patch        |
-----------------------------+--------------------------
 In Chrome 22, a response with a valid Last-Modified header will be cached
 despite Cache-Control and Expires headers. So even though the user is
 logged in, the resource is cached and the browser sends If-Modified-Since
 with subsequent requests. This can result in a strange, partially-logged
 out experience with batcache under certain conditions.

 In wp_get_nocache_headers(), the Last-Modified header is set to the
 current time. Setting its value to the empty string resolves the issue.

 I will post two patches: one which only empties the Last-Modified header
 in the array, another which also removes the header when the
 header_remove() function is defined (PHP >= 5.3).

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/22258>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list