[squid-users] Vary object loop returns
Yuri Voinov
yvoinov at gmail.com
Fri Jun 3 19:33:43 UTC 2016
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Man, you right.
You change dramatically increases HIT. Some checked sites with
traditional low HIT ratio now caching.
Wow.
03.06.2016 23:37, joe пишет:
> i will just have to do patch i work direct on source if you want
> i post and its not regx yet and the sbuf routine the dev guys shuld do it
> its missing function str.erase in sbuf i gess
> not good for production untill somone do regx match on --> %20 filter
> out
>
> int
> varyEvaluateMatch(StoreEntry * entry, HttpRequest * request)
> {
> SBuf vary(request->vary_headers);
> int has_vary = entry->getReply()->header.has(HDR_VARY);
> #if X_ACCELERATOR_VARY
> has_vary |=
> entry->getReply()->header.has(HDR_X_ACCELERATOR_VARY);
> #endif
>
>
> if (!has_vary || entry->mem_obj->vary_headers.isEmpty()) {
> if (!vary.isEmpty()) {
> /* Oops... something odd is going on here.. */
> debugs(33, DBG_IMPORTANT, "varyEvaluateMatch: Oops. Not a Vary
> object on second attempt, '" <<
> entry->mem_obj->urlXXX() << "' '" << vary << "'");
> request->vary_headers.clear();
> return VARY_CANCEL;
> }
>
> if (!has_vary) {
> /* This is not a varying object */
> return VARY_NONE;
> }
>
> /* virtual "vary" object found. Calculate the vary key and
> * continue the search
> */
> vary = httpMakeVaryMark(request, entry->getReply());
>
> if (!vary.isEmpty()) {
> request->vary_headers = vary;
> return VARY_OTHER;
> } else {
> /* Ouch.. we cannot handle this kind of variance */
> /* XXX This cannot really happen, but just to be complete */
> return VARY_CANCEL;
> }
> } else {
> if (vary.isEmpty()) {
> vary = httpMakeVaryMark(request, entry->getReply());
>
> if (!vary.isEmpty())
> request->vary_headers = vary;
> }
> if (!vary.isEmpty()) {
> std::string t = vary.c_str();
>
> std::string s = ",%20sdch";
> std::string::size_type i = t.find(s);
> if (i != std::string::npos){
> t.erase(i, s.length());
> }
>
> std::string s1 = ",%20deflate";
> std::string::size_type i1 = t.find(s1);
>
> if (i1 != std::string::npos){
> t.erase(i1, s1.length());
> }
>
> std::string s2 = ",%20gzip";
> std::string::size_type i2 = t.find(s2);
>
> if (i2 != std::string::npos){
> t.erase(i2, s2.length());
> }
>
> std::string s3 = ",%20identity";
> std::string::size_type i3 = t.find(s3);
>
> if (i3 != std::string::npos){
> t.erase(i3, s3.length());
> }
> vary=SBuf(t);
> return VARY_MATCH;
> }
> if (vary.isEmpty()) {
> /* Ouch.. we cannot handle this kind of variance */
> /* XXX This cannot really happen, but just to be complete */
> return VARY_CANCEL;
> } else if (vary.cmp(entry->mem_obj->vary_headers) == 0) {
> return VARY_MATCH;
> } else {
> /* Oops.. we have already been here and still haven't
> * found the requested variant. Bail out
> */
>
> debugs(33, DBG_IMPORTANT, "varyEvaluateMatch: Oops. Not a Vary
> match on second attempt, '" <<
> entry->mem_obj->urlXXX() << "' '" << vary << "'");
> return VARY_CANCEL;
> }
> }
> }
>
>
>
> just replace the old function on client_side.cc -->
varyEvaluateMatch with
> the one i post or i post later the patch
> dont lough im not pro but i do my home work
>
>
>
> --
> View this message in context:
http://squid-web-proxy-cache.1019090.n4.nabble.com/Vary-object-loop-returns-tp4677716p4677792.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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQEcBAEBCAAGBQJXUduWAAoJENNXIZxhPexGP1QH/2Fx0TWZrviMgFavyUsR6jXv
LADswxk5iCEX20frmDCbIGXRgbmzvGwohYcAWR5aCPCyJxirvkmnSN4KP6it6D5b
DuwrLVDcxBGg5CeR7ajRO9+yg/0r/MwF2NG7aLSa/ao+sxjJi+D+fRjxy5vQ3Ucq
TrxjdZn119dbrVkiP8mljoK4pohvEFT07pbA30K0mf2olRg98TTQFOFSWTnnPnjf
Lhpp60+o9h67p4ELBvAJ8yCloiFRs/2fljCpqDUkwIY74aIX/wjTfbh3+0VLNrYn
V6GKJ0zpGyr7OcM9BawjfJcoyjMEUy1ZCN5Yf+vjtSqG/UydVbX9OwnhapSlk5U=
=enzv
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0x613DEC46.asc
Type: application/pgp-keys
Size: 2437 bytes
Desc: not available
URL: <http://lists.squid-cache.org/pipermail/squid-users/attachments/20160604/766038c0/attachment.key>
More information about the squid-users
mailing list