]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Remove the refresh_pattern ignore-no-cache option
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 20 Oct 2012 08:01:32 +0000 (02:01 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 20 Oct 2012 08:01:32 +0000 (02:01 -0600)
With the HTTP/1.1 Cache-Control:no-cache compliance upgrade this option became
obsolete. Its main use-case was to force caching of responses which contained this
control. Revalidation is now happening and no-cache objects are cached by default.

The one remaining effect of ignoring no-cache is to prevent no-cache from allowing
authenticated responses being cached. Which is the opposite of its usually expected
result and allowing that change of behaviour would be counter productive.

src/RefreshPattern.h
src/cache_cf.cc
src/cf.data.pre
src/http.cc

index cac24864782bfb74f1180e445d76ee3b6e414fcb..b0c7b04bc90699d95822e78c097aa3cd2d4dbd58 100644 (file)
@@ -49,7 +49,6 @@ public:
         unsigned int override_lastmod:1;
         unsigned int reload_into_ims:1;
         unsigned int ignore_reload:1;
-        unsigned int ignore_no_cache:1;
         unsigned int ignore_no_store:1;
         unsigned int ignore_must_revalidate:1;
         unsigned int ignore_private:1;
index c92025c6dad822607c70a92a2fb29fd4c766c882..c1807b61e2f4f0b7ba15ca6d7c162dd1002d75e5 100644 (file)
@@ -808,15 +808,6 @@ configDoConfigure(void)
             break;
         }
 
-        for (R = Config.Refresh; R; R = R->next) {
-            if (!R->flags.ignore_no_cache)
-                continue;
-
-            debugs(22, DBG_IMPORTANT, "WARNING: use of 'ignore-no-cache' in 'refresh_pattern' violates HTTP");
-
-            break;
-        }
-
         for (R = Config.Refresh; R; R = R->next) {
             if (!R->flags.ignore_no_store)
                 continue;
@@ -2682,9 +2673,6 @@ dump_refreshpattern(StoreEntry * entry, const char *name, RefreshPattern * head)
         if (head->flags.ignore_reload)
             storeAppendPrintf(entry, " ignore-reload");
 
-        if (head->flags.ignore_no_cache)
-            storeAppendPrintf(entry, " ignore-no-cache");
-
         if (head->flags.ignore_no_store)
             storeAppendPrintf(entry, " ignore-no-store");
 
@@ -2723,7 +2711,6 @@ parse_refreshpattern(RefreshPattern ** head)
     int override_lastmod = 0;
     int reload_into_ims = 0;
     int ignore_reload = 0;
-    int ignore_no_cache = 0;
     int ignore_no_store = 0;
     int ignore_must_revalidate = 0;
     int ignore_private = 0;
@@ -2802,8 +2789,6 @@ parse_refreshpattern(RefreshPattern ** head)
             override_expire = 1;
         else if (!strcmp(token, "override-lastmod"))
             override_lastmod = 1;
-        else if (!strcmp(token, "ignore-no-cache"))
-            ignore_no_cache = 1;
         else if (!strcmp(token, "ignore-no-store"))
             ignore_no_store = 1;
         else if (!strcmp(token, "ignore-must-revalidate"))
@@ -2822,6 +2807,8 @@ parse_refreshpattern(RefreshPattern ** head)
             /* tell client_side.c that this is used */
 #endif
 
+        } else if (!strcmp(token, "ignore-no-cache")) {
+            debugs(22, DBG_PARSE_NOTE(2), "UPGRADE: refresh_pattern option 'ignore-no-cache' is obsolete. Remove it.");
         } else
             debugs(22, DBG_CRITICAL, "refreshAddToList: Unknown option '" << pattern << "': " << token);
     }
@@ -2868,9 +2855,6 @@ parse_refreshpattern(RefreshPattern ** head)
     if (ignore_reload)
         t->flags.ignore_reload = 1;
 
-    if (ignore_no_cache)
-        t->flags.ignore_no_cache = 1;
-
     if (ignore_no_store)
         t->flags.ignore_no_store = 1;
 
index c2f154bea96314b63c6fc4d7413020f1adb310d9..cd1119ed6b9fea8aabafbd8699e5900516961647 100644 (file)
@@ -4228,7 +4228,6 @@ DOC_START
                 override-lastmod
                 reload-into-ims
                 ignore-reload
-                ignore-no-cache
                 ignore-no-store
                 ignore-must-revalidate
                 ignore-private
@@ -4261,12 +4260,6 @@ DOC_START
                this feature could make you liable for problems which
                it causes.
 
-               ignore-no-cache ignores any ``Pragma: no-cache'' and
-               ``Cache-control: no-cache'' headers received from a server.
-               The HTTP RFC never allows the use of this (Pragma) header
-               from a server, only a client, though plenty of servers
-               send it anyway.
-
                ignore-no-store ignores any ``Cache-control: no-store''
                headers received from a server. Doing this VIOLATES
                the HTTP standard. Enabling this feature could make you
index 9bcc19956397ef9030e2c6944294f329a78b9778..e50a962a480c9b21b22464027319d29900e94c1c 100644 (file)
@@ -422,7 +422,7 @@ HttpStateData::cacheableReply()
 
 #if 0 // waiting on HTTPbis WG agreement before we do this
             // NP: given the must-revalidate exception we should also be able to exempt no-cache.
-        } else if (rep->cache_control->noCache() && !REFRESH_OVERRIDE(ignore_no_cache)) {
+        } else if (rep->cache_control->noCache()) {
             debugs(22, 3, HERE << "Authenticated but server reply Cache-Control:no-cache");
             mayStore = true;
 #endif