fbpx

Server Setup / Varnish

Exclude URL from Varnish cache

by , , revisited on


We have by far the largest RPM repository with NGINX module packages and VMODs for Varnish. If you want to install NGINX, Varnish, and lots of useful performance/security software with smooth yum upgrades for production use, this is the repository for you.
Active subscription is required.

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);
   }
...
}

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.