Magento 2 Full Page Cache Command LineFull Page Cache

« Back to Magento 2 Full Page Cache

The module comes with a handy command line utility that allows you to flush the whole cache or just specific URLs easily.

Empty the Cache

The below command will empty the whole cache. This includes all pages from all stores/websites.

bin/magento fishpig:bolt:flush

Remove Specific URLs from the Cache

If you don't want to remove everything from the cache but just want to remove a single URL, you can do so by passing options to the flush command.

--url

You can specify as many URL arguments as you like. The URL should be a relative URL.

bin/magento fishpig:bolt:flush --url /mens/jackets.html

You can specify multiple URLs in a single command.

bin/magento fishpig:bolt:flush --url /mens/jackets.html --url /womens/jackets.html

By default, all child pages of a given URL are flushed from the cache. This includes all different variations of the page (ie. query string parameters).

--store

By default, the URL will be removed from the cache for every store. You can limit the stores using the store option.

bin/magento fishpig:bolt:flush --url /mens/jackets.html --store 1 --store 2

You can also specify a store code rather than a store ID.

bin/magento fishpig:bolt:flush --url /mens/jackets.html --store default

--protocol

By default, the URL will be flushed for both https and http. If you only use one protocol on your site (ie. just https), it will be quicker to just specify https and skip http.

bin/magento fishpig:bolt:flush --url /mens/jackets.html --protocol https

Flush a Whole Website Section

Let's say you have a Magento WordPress integrated blog on your site that is available from /blog and you want to flush the whole blog from the cache. The following command will do that:

bin/magento fishpig:bolt:flush --url /blog

This will flush the /blog URL but also flush all children URLs of /blog and will empty all of the blog from the cache for every store. You can limit this to a specific store with the stores option (see above).