Hello,

When a user refreshes(F5) or performs a hard refresh(ctrl+F5) in their
browser, the browser includes the *Cache-Control: no-cache* header in the
request.
However, in our* production Varnish setup*, we have implemented a check
that treats* requests with Cache-Control: no-cache as cache misses*,
meaning it bypasses the cache and goes directly to the backend server
(Tomcat) to fetch the content.

*Example:*
in vcl_recv subroutine of default.vcl:

sub vcl_recv{
      #other Code
      # Serve fresh data from backend while F5 and CTRL+F5 from user
        if (req.http.Cache-Control ~ "(no-cache|max-age=0)") {
                set req.hash_always_miss = true;
        }
       #other Code
}


However, we've noticed that the *Cache-Control: no-cache header is not
being passed* to Tomcat even when there is a cache miss.
We're unsure why this is happening and would appreciate your assistance in
understanding the cause.

*Expected Functionality:*
If the request contains *Cache-Control: no-cache header then it should be
passed to Tomcat* at Backend.

Thanks & Regards
Uday Kumar
_______________________________________________
varnish-misc mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Reply via email to