Site icon GetPageSpeed

Exclude URL from Varnish cache

A selected page bypassing the Varnish cache while other pages remain cached

Sometimes you have that one page that needs to be excluded from Varnish cache. Here is how to do it.

Identify vcl_recv function in your VCL file (normally default.vcl).

Paste in the rule to bypass cache for particular page URL:


sub vcl_recv {
...
   if (req.url ~ "^/your-exact-url-here") {
      return (pass);
   }
...
}
Exit mobile version