Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#9281 closed feature request (wontfix)

use Last-Modified/If-Modified-Since

Reported by: jidanni's profile jidanni Owned by:
Milestone: Priority: lowest
Severity: trivial Version: 2.7.1
Component: Optimization Keywords: dev-feedback 2nd-opinion
Focuses: Cc:

Description

Apparently WordPress does no longer sends Last-Modified: HTTP headers,
nor anymore gives If-Modified-Since 304 replies, for simple HTTP
requests for a post, etc.

But with no revisions, and comments disallowed, nothing on my posts
changes for years; however WordPress responds to requests as if it
my post was constantly changing.

Too bad one can't define() a setting in wp-config.php that says to
trust the date of latest revision (and latest comment) from the
database, and send appropriate Last-Modified, etc.

Or maybe one must install caching plugins to restore this basic
functionality.

Change History (4)

#1 @DD32
16 years ago

  • Component changed from HTTP to Optimization
  • Keywords dev-feedback 2nd-opinion added
  • Milestone changed from Unassigned to Future Release
  • Owner set to anonymous
  • Type changed from defect (bug) to enhancement

It seems that WordPress only supports HTTP_IF_NONE_MATCH/HTTP_IF_MODIFIED_SINCE for Feeds, Since Plugin and Dynamic content may have changed since the last view, But WordPress would have no knowledge of such content.

Supporting if-modified-since for posts seems to be something which would have to be left to a themes custom code, or a plugin, Since having it in core would cause problems for the cases i mentioned above.

#2 @jidanni
16 years ago

  • Cc jidanni@… added

Well all I know is 304 stuff is a basic web technology... all the big
boys use it.

Embarrassing that WordPress can't say it the things it is emitting
have changed or not.

How that is to be calculated is an internal affair.

A banner ad rotation shouldn't change a Last-Modified date.

But a site notice added to each page might.

But I would still as a rule use the same date as you do for RSS.

...and let some fancy plugin tamper with that if it insists.

#3 @DD32
16 years ago

  • Type changed from enhancement to feature request

A banner ad rotation shouldn't change a Last-Modified date.

Correct

But a site notice added to each page might.

Correct.

How is WordPress supposed to know the difference?

Simple, It doesn't, Its content from the theme or a plugin that is changing, it *doesnt* know if the content has changed, It cant keep a copy of the output and compare it later, That wouldnt work.

The difference with feeds is that once they've got the feed, they don't want it again, theres no dynamic content in the feed for them, If an ad is inserted at the end of each post, they should get the ad that they originally got, not the latest one upon a refresh (Which mind you, would also cause duplicate items in their reader.. but thats a different story).

In my opinion: If you want to use 304's for your main page, Then use a plugin, Or a Caching plugin which ends up removing any dynamic abilities WP has to start with, which means it -can- then use static content, which means it does know if it was modified.

#4 @DD32
16 years ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

The current implementation for feeds works for me. I'm closing as wontfix due to the fact its impossible to reliably add it to core for dynamic themes.

In the event that someone wants it for a purely static page/site, Then i'd suggest its the place for a plugin, or extra couple of lines in the theme's functions.php.

Note: See TracTickets for help on using tickets.