[wp-hackers] Setting Last-Modified, Etags everywhere

Austin Matzko austin at ilfilosofo.com
Sat Jan 23 15:37:57 UTC 2010

On Sat, Jan 23, 2010 at 7:58 AM, Harish Narayanan
<harish.mlists at gmail.com> wrote:
> WordPress feeds seem to set both Last-Modified and Etags in the HTTP header:
> but posts and pages don't seem to:
> Is there some reason for this? I believe it might have something to do
> with how fancier pages might be generated (e.g. pulling different bits
> of dynamic/static content from different servers). But if there isn't a
> reason not to, I would like to try to add these fields to all WordPress
> generated content.

WordPress sets those tags for caching feeds because the
strictly-defined structure of the feed makes it easy to determine
whether it has changed (and therefore should no longer be cached).  In
contrast, it would be almost impossible for core WordPress to
determine whether the content on a regular page load has changed.

However, you can use the 'send_headers' action hook to modify the
headers for your own specific situation.

More information about the wp-hackers mailing list