I need an education about browsers and how they send dates in HTTP headers. My concern is that I cannot perform string comparisons if the user has a different browser or localization.
I currently have code similar to this for processing requests:
DateTime dt = getLastModified(someResourceHandle);
if(Request.Headers["If-Modified-Since"] == dt.ToString("R")) {
} else {
getFullResource(someResourceHandle);
}
Purpose: I do not want it to crash.
So, I looked at the request headers from several browsers:
When I use IE, with English as my language:
Accept-Language: en-us
If-Modified-Since: Tue, 30 Jun 2009 15:52:19 GMT
When I use IE, and French (Belgium) - as my language (I would expect "mar" instead of "Tue"):
Accept-Language: fr-be
If-Modified-Since: Tue, 30 Jun 2009 15:52:19 GMT
No matter what I get from Firefox:
Accept-Language: en-us,en;q=0.5
If-Modified-Since: Tue, 30 Jun 2009 15:52:19 GMT
, , (RFC 1123), , ( Windows).
?