]> git.ipfire.org Git - thirdparty/squid.git/commit
HTTP: MUST always revalidate Cache-Control:no-cache responses.
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Tue, 6 Sep 2016 07:41:16 +0000 (19:41 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 6 Sep 2016 07:41:16 +0000 (19:41 +1200)
commitfa83b766a208b27abed8da4c9073cf8784cf10fa
tree21f222ebdcc4090262aca517dd6d7b724adac438
parenta1b9ec20f3249d0478b2357edad095c1cc3fbcf4
HTTP: MUST 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.
src/enums.h
src/http.cc
src/refresh.cc
src/stat.cc
src/store.cc