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.

Share:
985

Related videos on Youtube

MDot
Author by

MDot

Updated on September 18, 2022

Comments

  • MDot
    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
      ravi yarlagadda over 11 years
      That 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
      Karel over 11 years
      Can 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
      Toby over 11 years
      Can't get any Varnish hits even with a basic VCL. I'm digging deeper, because I must be missing some obvious.
    • risnandar
      risnandar almost 11 years
      good catch :) i don't know about that. But my site now is running after read your sample configuration. Thanks !!
  • Toby
    Toby over 11 years
    Thanks! 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
    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
    Toby over 11 years
    I got the file from the here: fourkitchens.atlassian.net/wiki/display/TECH/… I will start from vanilla and go up. Thanks!
  • ravi yarlagadda
    ravi yarlagadda over 11 years
    Good 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
    Alex over 11 years
    One side note: Even if varnish does the base authorization itself and chaches the object, the browsers might still use uncached content
  • Nick Rolando
    Nick Rolando about 8 years
    I've been banging my head on this all day.. Thank you!!
  • Justin Thomas
    Justin Thomas over 7 years
    WHERE DO YOU PUT IT?!
  • MDot
    MDot almost 7 years
    It 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 ?