I would like to get more clarity on Magento cache algorithm.

I referred



Still, when I look at var/cache folder I can see mage--0 to mage--9 and mage--a from mage--f.

  1. What are all they?
  2. What do they do?
  3. How do they do?

Can someone explain this concept?

2 Answers 2


In Magento we have the following cache types:

  • Configuration

  • Layouts

  • Blocks HTML output
  • Translations
  • Collections Data
  • EAV types and attributes
  • Web Services Configuration

Why we need Magento caching ?

Data caching store variable in the cache. Cache creates a system folder in which it records all data received by the user from the network. When a document is requested again, webpage shows the contents of the cache. With the help of it browsers have no need to download from the internet all page elements every time you visit it, but simply to "pull" the elements (such as text or graphics) that have changed. In simple words, that is how cache storage management works. Therefore:

  • Significantly faster loading of already visited pages.
  • Reduction of your traffic. So we need cache to increase usability and make our website faster.

I'm not sure how much detail you want, but basically Magento will cache as much as it can, e.g.

  • Configuration XML files
  • Cached HTML
  • Session Data (technically not caching)

If you use the default 'file' value for storing cache, then it will store these values in the var/cache directory using Zend_Cache. These are the files you see there.

You can safely delete all these files, effectively clearing the cache, and Magento will regenerate them for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.