5

The Last-Modified header is set in includes/bootstrap.inc. Plain Drupal uses

header("Last-Modified: ". gmdate("D, d M Y H:i:s") ." GMT");

which yields

Last-Modified: Sun, 27 Jan 2013 21:52:57 GMT

Pressflow uses

$default_headers = array(
    'Last-Modified' => gmdate(DATE_RFC1123, $_SERVER['REQUEST_TIME']),

which yields

Last-Modified: Sun, 27 Jan 2013 21:52:57 +0000

'+0000' is incorrect according to RFC 2616, and is flagged as an invalid date by http://redbot.org/

What gives? Is this a Pressflow performance technique, or an error, or what? Do browsers care?

We're trying to nail down some load issues on our site, and want to be sure we are not getting more repeat requests than is appropriate.

  • In Pressflow 6 this used to be dynamic only in Pressflow and in Drupal it was set to the birthday of Dries. Perhaps this is simply a hangover from that era? – Stewart Robinson Jan 29 '13 at 7:32
  • I've worked with Pressflow a lot and subsequently done a lot of performance work in my day (chicago2011.drupal.org/sessions/…) and it's definitely not the problem you are looking to solve. The Last-Modified header being in the improper format only matters to the standards bots. Can you be more specific about "load issues" - Are you actively seeing a cache miss on pages? Is it slow for anonymous users only? What kind of Reverse Proxy are you using? (If any) – webkenny Feb 1 '13 at 5:39
  • Webkenny- We're working through our load issues, with Varnish, memcache, CDNs, etc. We had a typo in our Varnish config that was causing an invalid max-age header. When I checked on the fix for that with Redbot, I saw the last-modified issue. If you think this is not a problem I'll take your word for it, but I still have to ask - Why is it broken? – joe casey Feb 4 '13 at 14:23
2

Drupal 6 sets the Last-Modified header with

header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");

That was changed to

$default_headers = array(
  'Expires' => 'Sun, 19 Nov 1978 05:00:00 GMT',
  'Last-Modified' => gmdate(DATE_RFC1123, REQUEST_TIME),

during the development of drupal7. Pressflow has backported the patch from drupal7 in 2009. That's the reason of the difference. As for the possible impact of this, in fact it can have bad effects on caching. At least squid 3.1.10 prints a warning about the header and refuses to store the page in cache

cannot parse hdr field: 'Last-Modified: Tue, 12 Feb 2013 14:35:43 +0000'
[snip]...[/snip]
refreshIsCachable() returned non-cacheable..

Switching to the "GMT" version resolves the issue with squid.

rfc2616 (HTTP/1.1: Protocol Parameters:) specifies that "Last-Modified" header value can conform to rfc1123 (which looks OK with +0000) but all the examples use "GMT".

I think it'll be better to create a bug report in drupal issue tracker and see what the developers answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.