Stratus Magento 2 Guides - Purge the Varnish FPC

The Webscale STRATUS CLI is the best way to clear Varnish via the SSH container.
/usr/share/stratus/cli cache.varnish.clear

Curl also works if you are using SSH. The Varnish hostname is varnish:

curl -X 'PURGE' -H'X-Magento-Tags-Pattern: .*' varnish

Magento 2 users should set their http-cache-host accordingly:

php bin/magento setup:config:set --http-cache-hosts=varnish

Once the above is set, a typical cache clear via the Magento 2 admin or Magento commands is possible:

php bin/magento cache:clean

Varnish can also be purged via the Flush Cache button in the Varnish > Info Webscale STRATUS Admin panel.

Static Files Not Refreshing

Older Magento 2 versions have a bug in the VCL where static files will not refresh despite the purge listed above. See https://github.com/magento/magento2/issues/8113

As a workaround, run this command via shell access on your MageMojo server:

varnishadm "ban req.url ~ "/" "

Further reading

For more understanding about Magento 2 and Varnish, please read the official dev docs at https://experienceleague.adobe.com/docs/commerce-operations/configuration-guide/cache/varnish/use-varnish-cache.html


Last modified January 1, 0001