Join GitHub today
Ensure Date header on expires_in #3479
Background: Some webservers (thin and passenger for example) don't add a HTTP Date header to the response. This is not a problem for modern browsers but it can cause problems with other HTTP clients, for example Amazon's CloudFront expects a Date header when it gets a Cache-Control max-age value and .Net's HttpWebRequest's have some similar issue.
I can see that the Date header might not be Rails responsibility, but I think it would be good if
pushed a commit
this pull request
Dec 11, 2011
Is it not? The thin people don't think it's their responsibility either: https://thin.lighthouseapp.com/projects/7212/tickets/89-date-header-missing
I wonder, is there any harm in always setting a Date header (with or without expires_in even)? RFC 2616 seems to pretty much say it should be there unconditionally: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.18
Oh, and why I care about this obscure Date header thing? Because like @arvida I use CloudFront, which ignores max-age if I don't have the Date set.
For me this got triggered with a Sinatra app, but from this pull request it seems to me this might apply to Rails as well.