Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Explain Magento caching system

Could anyone explain about the Magento Caching system & how cache module works in Magento?

like image 846
Sankar Subburaj Avatar asked Feb 14 '12 19:02

Sankar Subburaj


1 Answers

Read more about it here: http://www.magentocommerce.com/wiki/modules_reference/english/mage_adminhtml/system_cache/index

or http://docs.magento.com/m1/ce/user_guide/system-operations/cache-management.html?Highlight=system%20cache

and for full page cahing:

http://docs.magento.com/m1/ce/user_guide/system-operations/cache-page-external.html?Highlight=system%20cache

From this link:

This screen will allow you to manage cache settings for different internal Magento aspects. To access the Cache Management screen (System > Cache Management)

Cache Control

In this fieldset you are presented with checkboxes, which, if checked, will enable cache for each aspect as described below.

During developing, i.e. changing files or database directly, disable all cache to avoid undefined behaviour.

After extension upgrade, installation or uninstallation, refresh all cache.

During moving Magento to another server, cached config.xml and local.xml are causing problems and have effectively locked you out of the admin panel. Find /app/etc/use_cache.ser and rename it to kill all caching manually and force reload of these files.

All Cache This select box is a convenience feature to apply an action to all checkboxes.

No Change - No action will be taken that will affect all aspects. Refresh - All cache will be cleaned, but all enabled aspects will remain enabled. Disable - Disable all cache. Enable - Enable all cache.

Currently the caching is implemented in core components mostly.

  • Configuration Here we cache merged config.xml files from app/etc/, all the modules and custom configuration saved in the database.

  • Layouts Compiling layout updates from app/design/[package]/[theme]/layout/*.xml files into layouts cache for each page

  • Blocks HTML output Every block can be cacheable by setting cache_lifetime and cache_key. This could involve pretty sophisticated logic to avoid representation inconsistencies between different blocks. Currently only admin top navigation block is cached.

  • EAV types and attributes EAV (entity-attribute-value model) requires configuration to be loaded from database. To speed up the initialization we cache this configuration.

  • Translations Every module and every theme can supply it’s own translation files (currently .csv) We cache all of them to avoid wasting time on recompilation.

You could play with setCacheLifetime and setCacheKey for blocks that display product data and see how it works for you

like image 167
ShaunOReilly Avatar answered Oct 31 '22 12:10

ShaunOReilly