Make WordPress Core


Ignore:
Timestamp:
10/23/2012 03:45:44 PM (12 years ago)
Author:
nacin
Message:

Do not issue a Last-Modified header when issuing no-cache headers to avoid aggressive (webkit) caching. Serve a blank header when header_remove() is not available (PHP < 5.3). props andy. fixes #22258.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r22276 r22283  
    903903    $headers = array(
    904904        'Expires' => 'Wed, 11 Jan 1984 05:00:00 GMT',
    905         'Last-Modified' => gmdate( 'D, d M Y H:i:s' ) . ' GMT',
     905        'Last-Modified' => '',
    906906        'Cache-Control' => 'no-cache, must-revalidate, max-age=0',
    907907        'Pragma' => 'no-cache',
     
    927927    foreach( $headers as $name => $field_value )
    928928        @header("{$name}: {$field_value}");
     929    if ( empty( $headers['Last-Modified'] ) && function_exists( 'header_remove' ) )
     930        header_remove( 'Last-Modified' );
    929931}
    930932
Note: See TracChangeset for help on using the changeset viewer.