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.
git-svn-id: http://core.svn.wordpress.org/trunk@22283 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4ddd44f32a
commit
a88114dd92
|
@ -381,6 +381,9 @@ class WP {
|
|||
foreach( (array) $headers as $name => $field_value )
|
||||
@header("{$name}: {$field_value}");
|
||||
|
||||
if ( isset( $headers['Last-Modified'] ) && empty( $headers['Last-Modified'] ) && function_exists( 'header_remove' ) )
|
||||
header_remove( 'Last-Modified' );
|
||||
|
||||
if ( $exit_required )
|
||||
exit();
|
||||
|
||||
|
|
|
@ -902,7 +902,7 @@ function status_header( $header ) {
|
|||
function wp_get_nocache_headers() {
|
||||
$headers = array(
|
||||
'Expires' => 'Wed, 11 Jan 1984 05:00:00 GMT',
|
||||
'Last-Modified' => gmdate( 'D, d M Y H:i:s' ) . ' GMT',
|
||||
'Last-Modified' => '',
|
||||
'Cache-Control' => 'no-cache, must-revalidate, max-age=0',
|
||||
'Pragma' => 'no-cache',
|
||||
);
|
||||
|
@ -926,6 +926,8 @@ function nocache_headers() {
|
|||
$headers = wp_get_nocache_headers();
|
||||
foreach( $headers as $name => $field_value )
|
||||
@header("{$name}: {$field_value}");
|
||||
if ( empty( $headers['Last-Modified'] ) && function_exists( 'header_remove' ) )
|
||||
header_remove( 'Last-Modified' );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue