Flush Magento Cache vs Flush Cache Storage

Magento, Quick Tip

This is question is asked and answered on Stack Overflow before, but it always surprises me how many people still don't know the difference. 

The difference is quite simply though:

  • Flush Magento Cache
    Deleted everything in the cache that is owned by Magento.

  • Flush Cache Storage
    Deletes everything in the cache storage, no matter if it's owned by Magento or not.

That is a little bit abstract. Let's explain this by example. Imagine you have an Magento 2 store that has it's cache configured to be saved in Redis. On the same server you have a Laravel application that also has it's cache configured to be saved in Redis. Normally you would set this up to have them both use different databases within Redis, but this is not always the case. Imagine that 60% of the cache items are created by Magento, and 40% of the items by Laravel.

Let see what happens if we do either of this action:

  • Flush Magento Cache
    This would flush 60% of the cache items. This number varies a little as Magento tries to deletes all known cache keys, but you might have a custom cache from a module that does not follow all rules.

  • Flush Cache Storage
    This will delete 100% of all keys in the cache, including the keys owned by Laravel. It doesn't make a distinction between the Laravel and Magento keys.

MageTested.com (ad)

Do you want your Magento store to be more reliable? Tired of things that suddenly break the checkout process without anyone noticing? You can hire my services to kickstart End-2-End testing for your Magento store. This way you know for sure that your store is behaving as expected before releasing that new feature or that update.

View MageTested.com for more information.

So when to choose which?

It's good to start to flush only the Magento cache, as it is the cleanest one. But if that doesn't solve your current issue, try the Flush Cache Storage variant as it is the most rigorous of the two. If your site is down and you need to find out why, slam this button to see if it helps.

Also, it depends a little on which cache driver you are using. If it is configured to use the database or the file system, there isn't much difference. If it is configured to use Redis, but Magento is the only consumer, then there is still little to none difference.

It all depends a little bit on your setup, but i think that in 99% of the cases there is little to none difference, that's why i'm most of the time defaulting to the Flush Cache Storage option. 

Want to respond?