------------------------------------------------------------ revno: 12367 revision-id: squid3@treenet.co.nz-20121016234645-37pwcizrkazozrjh parent: squid3@treenet.co.nz-20121016234607-l545ojr7jj6v6h80 committer: Amos Jeffries branch nick: 3.3 timestamp: Tue 2012-10-16 17:46:45 -0600 message: HTTP/1.1: honour Cache-Control before Pragma:no-cache HTTPbis WG clarifications on the interaction between Cache-Control and Pragma specify that Cache-Control may be explicitly crafted to allow conditional caching by HTTP/1.1 caches and Pragma:no-cache supplied to prevent caching by older HTTP/1.0 caches unable to understand the Cache-Control properly. Squid does obey Cache-Control. So we can deprecate Pragma to the side cases when Cache-Control is absent entirely. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20121016234645-37pwcizrkazozrjh # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.3 # testament_sha1: 62b26ef23c83c491de72c658a6ffed95751b4b8b # timestamp: 2012-10-16 23:47:09 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.3 # base_revision_id: squid3@treenet.co.nz-20121016234607-\ # l545ojr7jj6v6h80 # # Begin patch === modified file 'src/client_side_request.cc' --- src/client_side_request.cc 2012-10-04 09:14:06 +0000 +++ src/client_side_request.cc 2012-10-16 23:46:45 +0000 @@ -1046,19 +1046,14 @@ request->flags.ims = 1; if (!request->flags.ignoreCc) { - if (req_hdr->has(HDR_PRAGMA)) { - String s = req_hdr->getList(HDR_PRAGMA); - - if (strListIsMember(&s, "no-cache", ',')) - no_cache=true; - - s.clean(); - } - - if (request->cache_control) + if (request->cache_control) { if (request->cache_control->noCache()) no_cache=true; + // RFC 2616: treat Pragma:no-cache as if it was Cache-Control:no-cache when Cache-Control is missing + } else if (req_hdr->has(HDR_PRAGMA)) + no_cache = req_hdr->hasListMember(HDR_PRAGMA,"no-cache",','); + /* * Work around for supporting the Reload button in IE browsers when Squid * is used as an accelerator or transparent proxy, by turning accelerated