Why is Varnish not caching?
985
Well it turned it to be something super simple that I can't believe I missed: I was using a Apache Basic Authorization on the site and it looks like Varnish by default returns a pass when it sees the Authorization header.
Related videos on Youtube
Author by
MDot
Updated on September 18, 2022Comments
-
MDot over 1 year
In order to improve Remote Debugging performances, following this SO thread I'm trying to disable in STS (not plain eclipse) the "Show Monitors" from Debug View, but cannot find either the Menu Item or the icon.
As reference I also found the Eclipse Documentation mentioning the "Show Monitors" icon https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fviews%2Fdebug%2Fref-showmonitors.htm
but not able to find it anywhere in STS.
Anyone know how to toggle it in STS? Thanks.
-
ravi yarlagadda over 11 yearsThat whole big cookie logic block seems like a likely suspect; can you try removing it (and either strip all cookies to allow the default logic to cache, or put in a
return(lookup);
)? -
Karel over 11 yearsCan you post a curl -I from the Apache request on port 8080? That will tell us more than the headers of the Varnish'd page.
-
Toby over 11 yearsCan't get any Varnish hits even with a basic VCL. I'm digging deeper, because I must be missing some obvious.
-
risnandar almost 11 yearsgood catch :) i don't know about that. But my site now is running after read your sample configuration. Thanks !!
-
-
Toby over 11 yearsThanks! I tried that, and confirmed the etag was no longer appearing in the headers but it's still a miss each time. Also, the site does use the Varnish module.
-
alexus over 11 years@Justin update your initial post/question with reflected output, also where did you get that varnish's default.vcl file from? I think Shane Madden is right I also think it has something to do with that part of varnish configuration, start w/ little and work your way to what you have right now, you need to try few things out its kind of hard to give correct answer just like this, but etag is for sure not needed in order for cache to start working.
-
Toby over 11 yearsI got the file from the here: fourkitchens.atlassian.net/wiki/display/TECH/… I will start from vanilla and go up. Thanks!
-
ravi yarlagadda over 11 yearsGood catch! What I've always gone with is to include the default logic in my own config file, so that it's visible - then the
return
at the end of each function makes sure that nothing other than the config you've defined will be applied. -
Alex over 11 yearsOne side note: Even if varnish does the base authorization itself and chaches the object, the browsers might still use uncached content
-
Nick Rolando about 8 yearsI've been banging my head on this all day.. Thank you!!
-
Justin Thomas over 7 yearsWHERE DO YOU PUT IT?!
-
MDot almost 7 yearsIt works! Initial connection for remote-debugging is still slow but at least step-over step-into are much faster now!! Do you know any further setting to improve perfomance of Remote Debugging initial connection to the JVM ?