]> 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 12:32:21 +0000 (06:32 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 20 Oct 2012 12:32:21 +0000 (06:32 -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/cache_cf.cc
src/cf.data.pre
src/http.cc
src/structs.h

index cdb45ca56e426a980926eb6958d3973f1a8e484c..75b9a80ee6370e153ed69902f6d4a434d9e16135 100644 (file)
@@ -753,15 +753,6 @@ configDoConfigure(void)
             break;
         }
 
-        for (R = Config.Refresh; R; R = R->next) {
-            if (!R->flags.ignore_no_cache)
-                continue;
-
-            debugs(22, 1, "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;
@@ -2640,9 +2631,6 @@ dump_refreshpattern(StoreEntry * entry, const char *name, refresh_t * 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");
 
@@ -2681,7 +2669,6 @@ parse_refreshpattern(refresh_t ** 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;
@@ -2760,8 +2747,6 @@ parse_refreshpattern(refresh_t ** 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"))
@@ -2780,6 +2765,8 @@ parse_refreshpattern(refresh_t ** 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, 0, "refreshAddToList: Unknown option '" << pattern << "': " << token);
     }
@@ -2826,9 +2813,6 @@ parse_refreshpattern(refresh_t ** 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 540aecdc7881fd8b8f6f6de708e115b543ea7a51..5487a970689d2f12facf8067e651793be85ac5fe 100644 (file)
@@ -3943,7 +3943,6 @@ DOC_START
                 override-lastmod
                 reload-into-ims
                 ignore-reload
-                ignore-no-cache
                 ignore-no-store
                 ignore-must-revalidate
                 ignore-private
@@ -3976,12 +3975,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 de09782e0812f5c0b472a57248761f875615a421..3bcd73ce0157e8e48f14cc1098cec6234242ef0d 100644 (file)
@@ -408,7 +408,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
index 85b5da201bb624b07c27c263fad13c424196347e..3594015e1e5ca4920e53dd29c74823acdda43045 100644 (file)
@@ -1053,7 +1053,6 @@ struct _refresh_t {
         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;