WordPress.org

Plugin Directory

Changeset 426695


Ignore:
Timestamp:
08/21/11 12:55:16 (3 years ago)
Author:
yoavf
Message:

Re-use a file Last-Modified header if it exists, to prevent static files from only being cached for the duration of

File:
1 edited

Legend:

Unmodified
Added
Removed
  • batcache/trunk/advanced-cache.php

    r398110 r426695  
    322322    if ( $batcache->cache_control && isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ) { 
    323323        $since = strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']); 
     324        if ( isset($batcache->cache['headers']['Last-Modified']) ) 
     325            $batcache->cache['time'] = strtotime( $batcache->cache['headers']['Last-Modified'] ); 
    324326        if ( $batcache->cache['time'] == $since ) { 
    325327            header('Last-Modified: ' . $_SERVER['HTTP_IF_MODIFIED_SINCE'], true, 304); 
Note: See TracChangeset for help on using the changeset viewer.