Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High hits but the get request for the css, js,..... are not getting the header #2

Open
aelsharawi opened this issue May 15, 2017 · 11 comments

Comments

@aelsharawi
Copy link

Hi

thanks a lot for ur template hope u continue work on it

I had this stats
https://www.dropbox.com/s/njmi3cbf4myrlkg/Screenshot%202017-05-15%2002.14.18.png?dl=0
https://www.dropbox.com/s/qgfplha8lmx513w/Screenshot%202017-05-15%2002.13.23.png?dl=0

but in Pingdom i get this header:

https://www.dropbox.com/s/gz3b8dprxreqoxc/Screenshot%202017-05-15%2002.21.56.png?dl=0

is this is because "co-cache" ? but it is on for most files, although I asked varnish to ignore the cookie that my WordPress sets for a guest

please help me

@mattiasgeniar
Copy link
Owner

The "no-cache" request header is Pingdom requesting an uncached version, but Varnish will happily ignore that header.

If a request from cache was available, Varnish will have server that. Have you modified the VCL config in any way? That might influence the way headers are added/removed in the response.

@aelsharawi
Copy link
Author

Yes, I modified it, I would like u to have a look into it if you please, I will email u with the link.

@mattiasgeniar
Copy link
Owner

Sorry @aelsharawi , I can't offer individual support on VCLs, feel free to copy your code here and if time permits, I'll have a look.

Thanks,

M.

@aelsharawi
Copy link
Author

Ok thanks a lot

here is the link

https://pastebin.com/ngs8qErQ

best.

@aelsharawi
Copy link
Author

is this the correct syntax for hashing this kind of cookie?
learn_press_user_guest_id=12343232123e98998989

    if (req.http.cookie ~ "learn_press_user_guest_id=*") {
       return(hash);
    }

@mattiasgeniar
Copy link
Owner

Remove line 199 until 208, it adds logic to allow client-based cache flushing. Try again after, should improve cache hit rate.

@aelsharawi
Copy link
Author

Thanks a lot for offering such immediate help :)

Can U please advise on the best way to hash this cookie

learn_press_user_guest_id=12343232123e98998989

  if (req.http.cookie ~ "learn_press_user_guest_id=*") {
      return(hash);
   }

--- I will test the new modification now

@aelsharawi
Copy link
Author

fo r the cookie I figured it out,it shall be:

  if (req.http.cookie ~ "learn_press_user_guest_id") {
      return(hash);
   }

thanks again for help, I will test the nocache and report back

@aelsharawi
Copy link
Author

this is the new pingom
https://www.dropbox.com/s/a21276k34dg3fff/Screenshot%202017-05-15%2011.54.35.png?dl=0
it dose not show hit

however
http://www.isvarnishworking.com/ (on refresh, looks like the varnish creats a hash for the cookies)

shows

HTTP/1.1 200 OK
Date:	Mon, 15 May 2017 09:56:05 GMT
Content-Type:	text/html; charset=UTF-8
Last-Modified:	Thu, 01 Jan 1970 00:00:00 GMT
Expires:	Mon, 15 May 2017 10:56:05 GMT
ETag:	"648a710cc579a2d2097c4ec7a49ccd56"
Content-Encoding:	gzip
Vary:	Accept-Encoding
X-Varnish:	32800 32
Age:	3
X-Cache:	HIT
X-Cache-Hits:	1
Accept-Ranges:	bytes
Connection:	keep-alive

@aelsharawi
Copy link
Author

@aelsharawi
Copy link
Author

it was nginx mis-config which prevented js css caching, however I need to make sure Im using the hashing of the cookie correctly ? as I stated above to has the learn-press cookie ? as this plugin sets it for each guest!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants