I have a python backend, working as api with Varnish 3.0.7 in front. Every now and then I want to be able to clear varnish cache from my python app - e.i. after some documents have been updated.
I've been trying purge from this tutorial https://www.varnish-cache.org/docs/3.0/tutorial/purging.html but it only purge one object.
I know I can restart varnish but is there any way of deleting all cached objects?
You can do you it from varnishadmin (varnishadm "ban req.url ~ /"), I'm not sure if there's programmatic way to your requirement.
Update: You might take a look on that project https://github.com/justquick/python-varnish (didn't try it myself).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With