How to flush or clear varnish cache

Το πρόβλημα

Varnish is an HTTP accelerator designed for content-heavy dynamic web sites. In contrast to other HTTP accelerators, such as Squid, which began life as a client-side cache, or Apache, which is primarily an origin server, Varnish was designed from the ground up as an HTTP accelerator.

Η λύση

Well today I want to show you how to purge all the cache without the need to restart the daemon.

Κώδικας
varnishadm -T 127.0.0.1:6082 url.purge .

That will flush the cache.

Also to re-load Varnish configuration, you have several commands:

Command
Result

service varnish restart
Completely restarts Varnish, using the operating system mechanisms. Your cache will be flushed.

service varnish reload
Only reloads VCL. Cache is not affected.

Σας βοήθησε αυτή η λύση;

← Όλες οι λύσεις