How can we help you today?

How to Flush the Varnish Cache

Created by: Jesper Verkade

Modified on: Wed, 10 Jun, 2020 at 11:00 AM


Flushing the Varnish cache can be done using the Magento backend panel, but in case of problems, when the backend is not accessible, you might want to be able to flush the cache from the command line to fix any Varnish related caching issues.

You can flush the cache for a single domain, a specific URL or just the cache as a whole.

  • Flush a single domain:
    varnishadm "ban req.http.host ~ www.mydomain.com"
  • Flush a specific file type:
    varnishadm "ban req.url ~ .css"
  • Flush a specific file type of a single domain:
    varnishadm "ban req.http.host ~ www.mydomain.com" && req.url ~ .css"
  • Flush a specific URL
    varnishadm "ban req.url ~ /admin/something"
  • Flush the cache as a whole:
    varnishadm "ban req.url ~ ."
J
Jesper is the author of this solution article.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.