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 and on Port 2222 then the command would be:

varnishadm –T ban.url /home/page.html