[squid-users] Vary object loop returns

Yuri yvoinov at gmail.com
Sun Jun 5 09:03:00 UTC 2016


Build with this patch now.

Correctly formatted patch attached.

05.06.2016 2:39, joe пишет:
> Yuri can you test this pls if its better
> --- src/client_side.cc	2016-05-25 02:27:13.000000000 +0300
> +++ src/client_side.cc	2016-06-04 23:14:16.000000000 +0300
> @@ -140,7 +140,7 @@
>   #if LINGERING_CLOSE
>   #define comm_close comm_lingering_close
>   #endif
> -
> +#include <regex>
>   /// dials clientListenerConnectionOpened call
>   class ListeningStartedDialer: public CallDialer, public
> Ipc::StartListeningCb
>   {
> @@ -4738,6 +4738,17 @@
>               if (!vary.isEmpty())
>                   request->vary_headers = vary;
>           }
> +        /* new test in vary header there is unwanted mark deed code wish is
> marked with %20 tell the browser not to use */
> +        /* and its affecting the cache for cache hit %   if you use 2
> browser example Firefox and chrome and load object */
> +        /* that has vary --> accept-encoding="gzip,%20deflate,%20sdch */
> +        /* second browser use the same object link and has different
> accept-encoding="gzip,%20deflate" */
> +        /* as you notice they do not match so result miss and it delete the
> previous object from the cache */
> +        /* the new code should filter out those marked with %20 the
> different is really big in % hit */
> +        if (!vary.isEmpty()) {
> +            std::regex e ("\\b(,%20)(.*)([,\"]$)");
> +            vary=SBuf(std::regex_replace (vary.c_str(),e,"")+"\"");
> +             return VARY_MATCH;
> +        }
>   
>           if (vary.isEmpty()) {
>               /* Ouch.. we cannot handle this kind of variance */
>
>
>
> please guys its not for production migh have a different affect or bug only
> test wen the dev team approve it or make a better vertion
>
>
>
> --
> View this message in context: http://squid-web-proxy-cache.1019090.n4.nabble.com/Vary-object-loop-returns-tp4677716p4677808.html
> Sent from the Squid - Users mailing list archive at Nabble.com.
> _______________________________________________
> squid-users mailing list
> squid-users at lists.squid-cache.org
> http://lists.squid-cache.org/listinfo/squid-users

-------------- next part --------------
яЛП--- src/client_side.cc	2016-05-25 02:27:13.000000000 +0300
+++ src/client_side.cc	2016-06-04 23:14:16.000000000 +0300
@@ -140,7 +140,7 @@
 #if LINGERING_CLOSE
 #define comm_close comm_lingering_close
 #endif
-
+#include <regex>
 /// dials clientListenerConnectionOpened call
 class ListeningStartedDialer: public CallDialer, public Ipc::StartListeningCb
 {
@@ -4738,6 +4738,17 @@
             if (!vary.isEmpty())
                 request->vary_headers = vary;
         }
+        /* new test in vary header there is unwanted mark deed code wish is marked with %20 tell the browser not to use */
+        /* and its affecting the cache for cache hit %   if you use 2 browser example Firefox and chrome and load object */
+        /* that has vary --> accept-encoding="gzip,%20deflate,%20sdch */
+        /* second browser use the same object link and has different accept-encoding="gzip,%20deflate" */
+        /* as you notice they do not match so result miss and it delete the previous object from the cache */
+        /* the new code should filter out those marked with %20 the different is really big in % hit */
+        if (!vary.isEmpty()) {
+            std::regex e ("\\b(,%20)(.*)([,\"]$)");
+            vary=SBuf(std::regex_replace (vary.c_str(),e,"")+"\"");
+             return VARY_MATCH;
+        }

         if (vary.isEmpty()) {
             /* Ouch.. we cannot handle this kind of variance */


More information about the squid-users mailing list