From 79c9ab06844950251c793ed5192bf1d86482f1f7 Mon Sep 17 00:00:00 2001 From: michelvaldrighi Date: Sun, 22 Feb 2004 03:29:54 +0000 Subject: [PATCH] if we're doing feeds, we shall not send 'always modified' headers git-svn-id: https://develop.svn.wordpress.org/trunk@909 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-blog-header.php | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/wp-blog-header.php b/wp-blog-header.php index 2afe667a9f..458e9cbba5 100644 --- a/wp-blog-header.php +++ b/wp-blog-header.php @@ -73,13 +73,20 @@ $wpvarstoreset = array('m','p','posts','w', 'cat','withcomments','s','search','e /* Sending HTTP headers */ -// It is presumptious to think that WP is the only thing that might change on the page. -@header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past -@header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified -@header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1 -@header("Cache-Control: post-check=0, pre-check=0", false); -@header("Pragma: no-cache"); // HTTP/1.0 -@header ("X-Pingback: $siteurl/xmlrpc.php"); + +if (!isset($doing_rss) || !$doing_rss) { + // It is presumptious to think that WP is the only thing that might change on the page. + @header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past + @header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified + @header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1 + @header("Cache-Control: post-check=0, pre-check=0", false); + @header("Pragma: no-cache"); // HTTP/1.0 + @header ("X-Pingback: $siteurl/xmlrpc.php"); +} else { + // We're showing a feed, so WP is indeed the only thing that last changed + @header('Last Modified: ' . gmdate(get_lastpostmodified())); + @header ("X-Pingback: $siteurl/xmlrpc.php"); +} /* Getting settings from db */ if (isset($doing_rss) && $doing_rss == 1)