[squid-dev] Fix If-None-Match processing and related bug 4169

Alex Rousskov rousskov at measurement-factory.com
Mon Dec 5 05:08:44 UTC 2016

On 12/04/2016 08:57 PM, Amos Jeffries wrote:
> On 5/12/2016 4:05 p.m., Alex Rousskov wrote:
>> All these
>> conditional headers have the same overall logic: If the answer to the
>> "If" question asked by the header field name is "yes", then the header
>> field is essentially ignored.

> FWIW; I find it easier to process thee headers logic in human terms by
> prefixing "send a 200" to the conditionals, which are in turn joined
> with "AND".
> So this case is "send a 200 if none match" :-)

That works nicely indeed, but I do not recommend writing the
corresponding code _comments_ that way because they trick developers
into incorrectly thinking that Squid will return a 200 OK response to
the client. In reality, the response may differ (e.g., because the
cached response is not a 200 OK response or, in some contexts, because
we fail to swap the cached 200 OK response in).

>> How about:
>>   // None-Match is true (no one matched); treat as an unconditional hit
> I think s/no one/no Etag/ to be clearer on what 'one' is going on about.

I was just spelling out "None" as "no one". I have no objections to "no
Etag" phrasing.


More information about the squid-dev mailing list