[squid-dev] [PATCH] Must revalidate CC:no-cache responses

Eduard Bagdasaryan eduard.bagdasaryan at measurement-factory.com
Fri Sep 2 22:14:22 UTC 2016


Hello,

This patch forces Squid to always revalidate Cache-Control:no-cache
responses.

Squid MUST NOT use a CC:no-cache response for satisfying subsequent
requests without successful validation with the origin server. Squid
violated this MUST because Squid mapped both "no-cache" and
"must-revalidate"/etc. directives to the same ENTRY_REVALIDATE flag
which was interpreted as "revalidate when the cached response becomes
stale" rather than "revalidate on every request".

This patch splits ENTRY_REVALIDATE into:
- ENTRY_REVALIDATE_ALWAYS, for entries with CC:no-cache and
- ENTRY_REVALIDATE_STALE, for entries with other related CC directives
   like CC:must-revalidate and CC:proxy-revalidate.

Reusing ENTRY_CACHABLE_RESERVED_FOR_FUTURE_USE value for the more
forgiving ENTRY_REVALIDATE_STALE (instead of the more aggressive
ENTRY_REVALIDATE_ALWAYS) fixes the bug for the already cached entries -
they will be revalidated and stored with the correct flag on the next
request.


Regards,
Eduard.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20160903/3ab1b7c5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SQUID-228-must-revalidate-no-cache-responses-t2.patch
Type: text/x-patch
Size: 13658 bytes
Desc: not available
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20160903/3ab1b7c5/attachment.bin>


More information about the squid-dev mailing list