If-Modified. Since the HTTP header passed by IE9 includes the length?

Clarify this strange If-Modified-Since header passed by IE9

In my ASP.NET 4.0 web application, I have a generic handler (.ashx) that serves the images stored in the database. In the interest of efficiency, I process some of the caching related headers and pass cache information.

I get DateTime parsing errors moderately often, trying to parse the contents of the If-Modified-Since header, usually from IE9. Turns out he sends something like this:

Mon, Nov 28, 2011 4:34:52 PM GMT; length = 8799

I process this using a regex to cut out the last part. But I'm curious: what length does this refer to, and what is it? Is the size of the cached data for the requested URL?

+6
source share
2 answers

According to the old message on the Squid proxy mailing list:

The length parameter for If-Modified-Since is an extension of Netscape HTTP / 1.0, designed to improve the accuracy of If-Modified-as in the case the document is updated twice in the same second.

HTTP / 1.1 solved the same problem better with the ETag header and If-None-Match.

I assume that IE adapted this extension at some point and left it.

+1
source

This is similar to the old Netscape extension of the header field (see the ancient discussion on http-wg ); even if it is apparently against HTTP / 1.0 and HTTP / 1.1 (the idea has been (functionally) replaced by the ETag header). I don't know if / why IE9 sends it and in what specific conditions (I would assume that only a specific combination of cache headers starts it).

I think the best solution would be to drop something after the semicolon, which is commonly used in HTTP to separate extension options in headers (see for example the Accept header ).

+1
source

Source: https://habr.com/ru/post/926431/


All Articles