Skip to main content

How to clear Varnish cache for a single URL?

Varnish cache can be clear for a single URL simply by using “ban” command. See the examples below:

To clear or purge the cache use the following command.

varnishadm –T [Varnish Port IP address] ban.url [URL Path]


So for example if your environment Varnish is running on 192.168.1.100 and on Port 2222 then the command would be:

varnishadm –T 192.168.1.100:2222 ban.url /home/page.html