Re: HTTP Compliance: What to do with Age:0 and IE5?

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Fri, 01 Oct 2010 01:29:56 +1300

On 28/09/10 09:43, Alex Rousskov wrote:
> Hello,
>
> The following Squid code prevents adding an "Age: 0" header to cache
> hits. Squid sends positive age values only, violating RFC 2616:
>
>> * BROWSER WORKAROUND: IE sometimes hangs when receiving a 0 Age
>> * header, so don't use it unless there is a age to report. Please
>> * note that Age is only used to make a conservative estimation of
>> * the objects age, so a Age: 0 header does not add any useful
>> * information to the reply in any case.
>> */
> ...
>> if (http->storeEntry()->timestamp < squid_curtime) {
>> hdr->putInt(HDR_AGE,
>> squid_curtime - http->storeEntry()->timestamp);
>
>
> The above lines were added to Squid3 in March 2000 (trunk r4375). The
> log message says "Merge changes from 2.3 branch. Mostly this is
> copyright text changes."
>
> I believe the hack origins are related to this January 2000 patch:
>
> http://devel.squid-cache.org/hno/patches/squid-2.2.STABLE5.age.patch
>
> The above patch sites IE5 as the possible culprit. Henrik may remember
> the missing details.
>
>
> I see several options:
>
> 0a) Do nothing. Continue to violate RFC 2616. Keep IE5 users happy.
>
> 0b) Wrap the IE5 exception in USE_HTTP_VIOLATIONS. Since that #define is
> enabled by default, it does not change stock Squid behavior, but we can
> start testing compliance using an unrealistic USE_HTTP_VIOLATIONS=0
> configuration to hide this violation.
>
> 1) Remove the hack. Fix the violation. Upset IE5 users.
>
> 2) Make the hack conditional on IE5. I assume it is possible via the
> User-Agent header parsing, but I am not sure. This would effectively fix
> the violation. This option requires more development work and makes all
> zero-age hits slightly slower to keep IE5 users happy.
>
>
> I suggest #1, with #2 as a backup plan if we get complaints.
>
>
> What do you recommend?

Agreed: #1. Timing is about right with IE5 under 1% market share now and
still declining.

Wrapping it in a custom macro (maybe "HTTP_VIOLATIONS && IE5_SUPPORT" ?)
that admin can set at build time would be better than 2.

Amos
Received on Thu Sep 30 2010 - 12:30:02 MDT

This archive was generated by hypermail 2.2.0 : Thu Sep 30 2010 - 12:00:08 MDT