Search squid archive

Re: Vary object loop returns

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
 
Properly formatted patch.


05.06.2016 22:28, joe пишет:
> Quotation marks fix
>
> --- src/client_side.cc    2016-05-25 02:27:13.000000000 +0300
> +++ src/client_side.cc    2016-06-05 19:04:07.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,23 @@
>              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)(.*)([,\"]$)"); 
> +            std::string str1 = std::regex_replace
(vary.c_str(),e,"")+"\"";
> +            if (str1.find("\"\"") != std::string::npos) {
> +               str1.erase(str1.begin() + str1.size() - 1);
> +               vary=SBuf(str1);
> +            } else {
> +               vary=SBuf(str1);
> +            }
> +             return VARY_MATCH;
> +        }
> 
>          if (vary.isEmpty()) {
>              /* Ouch.. we cannot handle this kind of variance */
>
>
>
> --
> View this message in context:
http://squid-web-proxy-cache.1019090.n4.nabble.com/Vary-object-loop-returns-tp4677716p4677818.html
> Sent from the Squid - Users mailing list archive at Nabble.com.
> _______________________________________________
> squid-users mailing list
> squid-users@xxxxxxxxxxxxxxxxxxxxx
> http://lists.squid-cache.org/listinfo/squid-users

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
 
iQEcBAEBCAAGBQJXVGzMAAoJENNXIZxhPexGji0H/2h991uHwX/wweYc7rgeqGwk
hT53tn0WrNWZxp2DKXT14Hq4m8HEbuP9KPLedEwbqDx/sXZOf/Flw9CxSEMLB16T
+SjMxCSDa9je6/3ego5aAg26jRwfebO6VD+BdOQs+ZYVb/RWcONCWZyhJbfuR5ik
PSwr8ar8tkpsolyCAPwdvnjEuFvnuESxfGVMdQCzDJEo8CUFrp3JaOK2TMsNG3a/
6z4QJ0SFJiRKq7fmkrV8Z4I2uaPE6I21KX4k9eYglz1771+CiegCjp/BslqBovuv
Bj0B+Pz98+6wC9eMguVviFqT2Huc16V8QWOwLfzkq+it/cYGnOKuSKh9L6dmGf0=
=gIpI
-----END PGP SIGNATURE-----

--- src/client_side.cc	2016-05-25 02:27:13.000000000 +0300
+++ src/client_side.cc	2016-06-04 23:14:16.000000000 +0300
@@ -141,6 +141,7 @@
 #define comm_close comm_lingering_close
 #endif
 
+#include <regex>
 /// dials clientListenerConnectionOpened call
 class ListeningStartedDialer: public CallDialer, public Ipc::StartListeningCb
 {
@@ -4739,6 +4740,24 @@
                 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)(.*)([,\"]$)");  
+            std::string str1 = std::regex_replace (vary.c_str(),e,"")+"\"";
+            if (str1.find("\"\"") != std::string::npos) {
+               str1.erase(str1.begin() + str1.size() - 1);
+               vary=SBuf(str1);
+            } else {
+               vary=SBuf(str1); 
+            }
+             return VARY_MATCH;
+         }
+
         if (vary.isEmpty()) {
             /* Ouch.. we cannot handle this kind of variance */
             /* XXX This cannot really happen, but just to be complete */

Attachment: 0x613DEC46.asc
Description: application/pgp-keys

_______________________________________________
squid-users mailing list
squid-users@xxxxxxxxxxxxxxxxxxxxx
http://lists.squid-cache.org/listinfo/squid-users

[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux