114

What is the difference between "Flush Magento Cache" and "Flush Cache Storage" in magento's cache management?

enter image description here

Anthony
  • 2,371
  • 3
  • 20
  • 26

10 Answers10

125

Sometimes the cache location (like /tmp/) or service (like Memcache) is shared with other applications. "Flush Magento Cache" removes only those entries that Magento reliably tracks as its own. "Flush Cache Storage" clears everything but might affect other applications if they're using it.

Normally the location is var/cache/ in Magento's folder so is not shared after all. It is safe to use either button. Sometimes (rarely) entries are not clearly tagged or Magento loses track of them and only the second button has an effect on them. I tend to use the second button when I'm having difficulty tracking down the cause of a problem.

Vusys
  • 521
  • 3
  • 16
clockworkgeek
  • 37,650
  • 9
  • 89
  • 127
  • Thanks! I've always wondered what the heck "may contain another data" meant. – Nicholas Piasecki May 10 '11 at 20:07
  • 3
    I've gotten into the habit of using the nuclear option and use "Flush Cache Storage". If that doesn't do it then navigating to var/cache and nuking all the mage--? directories does the trick. – Fiasco Labs May 10 '11 at 20:58
  • @Nicholas if your memcache/apc instance is used by other applications as well they will get flushed too – Anton S May 10 '11 at 21:10
  • 1
    @Fiasco - Since either flush button loads the page again another request is made to Magento which immediately starts making new `mage--*` directories. Manually deleting the same must be the ultimate since it doesn't cause new cache entries. [MageTool](https://github.com/alistairstead/MageTool) has a clear cache command for this purpose. – clockworkgeek May 10 '11 at 21:23
  • **How** can it affect other applications ?? Each site on server has its own folders in their own directory. This is not clear, sorry – Pratik Joshi Aug 05 '15 at 08:04
  • @PratikCJoshi Normally that would be right but sometimes it is not. Please read the answer again. – clockworkgeek Aug 05 '15 at 17:37
  • What functions are called when both buttons are clicked ? – Vicky Dev Aug 01 '16 at 05:58
  • @VickyDev The buttons call `Mage::app()->cleanCache()` and `Mage::app()->getCacheInstance()->flush()` respectively. You can see this quite clearly in `app/code/core/Mage/Adminhtml/controllers/CacheController.php` – clockworkgeek Aug 01 '16 at 12:27
26

Flush Magento Cache

Removes all items in the default Magento cache (var/cache) and the var/full_page cache that have a Magento tag

Flush Cache Storage

Removes all items in the cache. This is the equivalent of deleting the entire contents of the cache folder on the server.If your system uses an alternate cache location, any cached files used by other applications will be removed.

SIBHI S
  • 667
  • 1
  • 12
  • 19
1

As a practical example, if you use magento's cache for your own devices, eg;

$cache = Mage::app()->getCache();
$cache->save("My cached text","cache_name",array("my_cache"),60*60*24);
echo $cache->load("cache_name");

You will need to use flush cache storage to clear this if you make an update.

In my case it's for a dynamically generated 3 level off canvas menu.

Matt
  • 428
  • 3
  • 15
1

Please find the difference between “Flush Magento Cache” and “Flush Cache Storage” below:

Flush Cache Storage: This function basically clears out the entire cache, all cache tags. This calls the “flush()” function on “core/cache” model.

Flush Magento Cache: This function clears cache tags “MAGE” and “CONFIG”. This class the “clean()” function in “core/cache” model.

Abhinav Kumar Singh
  • 2,325
  • 1
  • 10
  • 11
1

Magento Cache: Remove all items in the default Magento cache (var/cache).According to its associated Magento tag.

Flush Cache Storage: Remove all items from the cache regardless Magento tag. If you used another location used by other application will be removed in this process.

0

Here is the answer of your query:

Flush Magento Cache When you perform this action, the contents having Magento tag in var/cache and var/full_page_cache are removed.

Flush Cache Storage Well, it removed all contents of cache. In case you are using alternate cache location or application such as Varnish Cache which is a web application accelerator also known as a caching HTTP reverse proxy. Then it will remove cache from there too.

Manish Joy
  • 476
  • 3
  • 17
0

You have to flush cache storage if you modify the columns of a table (add or remove column) because magento executes a mysql DESCRIBE query and then saves the result in cache. This cache is not cleared if you only click on "Flush Magento Cache" button.

Daniel Illescas
  • 5,346
  • 3
  • 17
  • 23
mossaab
  • 33
  • 5
0

Typically, cache:clean deletes all enabled cache related to magento whereas cache:flush deletes the whole cache storage, whether its magento cache or any third party cache (whether enabled or disabled)

Manashvi Birla
  • 2,837
  • 3
  • 14
  • 28
0

Flush Magento Cache It's used to remove cache generated by default magento var/cache and var/full_page.

Flush Cache Storage It's used to remove all types of cache(Magento cache and cache created by other external providers.

Magento Dev
  • 111
  • 9
0

Magento Cache: Remove all items in the default Magento cache (var/cache).According to its associated Magento tag.

Flush Cache Storage: Remove all items from the cache regardless Magento tag. If you used another location used by other application will be removed in this process.