What is the easiest way to tell varnish:
Hey Varnish processes, please clear your cache. And also please don't cache anything at all right now. I want you to just pass all requests straight to the backend for now. I'll let you know when I want you to go back to normal operation in a bit.
I'm doing some debugging and iterating on a website, but I'm tired of constantly clearing my cache with this command between every change & new request.
varnishadm 'ban req.url ~ "."'
Also, this is a fairly complex varnish config that has many backends for many distinct websites & domains.
I just want the simplest command that will tell varnish to temporarily force all requests to the backend.
# this command does not exist
varnishadm 'caching-pause req.url ~ "."'
And the corresponding simple command to restore varnish back to normal operation.
# this command also does not exist
varnishadm 'caching-resume req.url ~ "."'
Is there some easy way to tell varnish to temporarily stop caching everything?
Ensure the following VCL code is in
/etc/varnish/no-cache.vcl
:Then load the VCL as follows:
Whenever you want Varnish to bypass the cache, run the following command:
If you want to go back to normal operations and your regular VCL is named
boot
, just use the following command: