]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Joe Cooper's hack for broken MSIE clients. They don't send no-cache
authorwessels <>
Sat, 9 Dec 2000 07:09:04 +0000 (07:09 +0000)
committerwessels <>
Sat, 9 Dec 2000 07:09:04 +0000 (07:09 +0000)
in transparent mode.

src/cf.data.pre
src/client_side.cc
src/structs.h

index 8614967603ff250ad2fcf30768ce5ee1a3f1ca49..ab160518d1f0dadba9e6a10ca689a682e77e2d83 100644 (file)
@@ -1,6 +1,6 @@
 
 #
-# $Id: cf.data.pre,v 1.199 2000/11/01 04:03:14 wessels Exp $
+# $Id: cf.data.pre,v 1.200 2000/12/09 00:09:04 wessels Exp $
 #
 #
 # SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -3282,5 +3282,29 @@ DOC_START
        This is currently work in progress.
 DOC_END
 
+NAME: ie_refresh
+COMMENT: on|off
+TYPE: onoff
+LOC: Config.onoff.ie_refresh
+DEFAULT: off
+DOC_START
+       Microsoft Internet Explorer up until version 5.5 Service
+       Pack 1 has an issue with transparent proxies, wherein it
+       is impossible to force a refresh.  Turning this on provides
+       a partial fix to the problem, by causing all IMS-REFRESH
+       requests from older IE versions to check the origin server
+       for fresh content.  This reduces hit ratio by some amount
+       (~10% in my experience), but allows users to actually get
+       fresh content when they want it.  Note that because Squid
+       cannot tell if the user is using 5.5 or 5.5SP1, the behavior
+       of 5.5 is unchanged from old versions of Squid (i.e. a
+       forced refresh is impossible).  Newer versions of IE will,
+       hopefully, continue to have the new behavior and will be
+       handled based on that assumption.  This option defaults to
+       the old Squid behavior, which is better for hit ratios but
+       worse for clients using IE, if they need to be able to
+       force fresh content.
+DOC_END
+
 EOF
 
index 199f34d669f16eda23d54777af81c8263c2d3816..3468c47ce09a274c06a2e3ae43a324465d46ebbf 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.515 2000/12/08 23:58:08 wessels Exp $
+ * $Id: client_side.cc,v 1.516 2000/12/09 00:09:04 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -830,9 +830,7 @@ clientInterpretRequestHeaders(clientHttpRequest * http)
     request_t *request = http->request;
     const HttpHeader *req_hdr = &request->header;
     int no_cache = 0;
-#if defined(USE_USERAGENT_LOG) || defined(USE_REFERER_LOG)
     const char *str;
-#endif
     request->imslen = -1;
     request->ims = httpHeaderGetTime(req_hdr, HDR_IF_MODIFIED_SINCE);
     if (request->ims > 0)
@@ -847,6 +845,28 @@ clientInterpretRequestHeaders(clientHttpRequest * http)
     if (request->cache_control)
        if (EBIT_TEST(request->cache_control->mask, CC_NO_CACHE))
            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 IMS request to no-cache requests.
+     * Now knows about IE 5.5 fix (is actually only fixed in SP1, 
+     * but we can't tell whether we are talking to SP1 or not so 
+     * all 5.5 versions are treated 'normally').
+    */
+    if (Config.onoff.ie_refresh) {
+        if (http->flags.accel && request->flags.ims) {
+           if ( (str = httpHeaderGetStr(req_hdr, HDR_USER_AGENT)) ) {
+               if (strstr(str, "MSIE 5.01") != NULL)
+                   no_cache++;
+               else if (strstr(str, "MSIE 5.0") != NULL)
+                   no_cache++;
+               else if (strstr(str, "MSIE 4.") != NULL)
+                   no_cache++;
+               else if (strstr(str, "MSIE 3.") != NULL)
+                   no_cache++;
+            }
+        }
+    }
+
     if (no_cache) {
 #if HTTP_VIOLATIONS
        if (Config.onoff.reload_into_ims)
index f89cc6d799646b0a61fcebd374333d433eafcae8..6eeb3fbe9aa834fd3abeada36b193809b64ac73a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: structs.h,v 1.365 2000/12/08 23:58:09 wessels Exp $
+ * $Id: structs.h,v 1.366 2000/12/09 00:09:04 wessels Exp $
  *
  *
  * SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -430,6 +430,7 @@ struct _SquidConfig {
 #endif
        int log_ip_on_direct;
        int authenticateIpTTLStrict;
+       int ie_refresh;
     } onoff;
     acl *aclList;
     struct {