What is enterprise caching in Magento and why should a merchant care?
One of the elements within Magento Enterprise that enables it to scale more effectively than Magento Community is its use of Full Page Caching. In talking with one of our Certified Magento Developers, Russell Mantilla, I realized there is a great deal of value in sharing some of the details around this with the wider community. For those with large or quickly growing catalogs, this is an architectural element of Magento Enterprise should strongly consider when evaluating which solution is right for you. Below is a portion of my conversation with Russell.
DJ: “Most people look at ‘caching’ and see that there is some form in each version of Magento. But most don’t understand fully what it is and there is more than one type of caching available. Can you give a simple overview for reference?”
RM: “Magento Cache is a system built into all versions of Magento to speed up performance of the Magento store front. It does this by saving “blocks” of information previously requested from the database to the files system for quicker retrieval, and in turn faster web-server response time and page loading. This includes side blocks (polls, layered navigation), product attributes (price, stock amounts, stock status), categories(hierarchy, products) and images(product images, category images). In Magento Enterprise, and Magento Go there is also Full Page Cache, which extend base Magento cache functionality to all “blocks” generated by Magento, not just products and categories, but also static CMS pages and CMS blocks.”
DJ: “So why should I care about this? If I just buy a big server, is this really necessary?”
RM: “Naturally, there are specific situations that having Magento Cache enabled can help improve the customer experience. Stores with many products and multiple levels of categories can cause Magento to bog down when a request is made on the server. Magento Cache solves this by pre-calculating category hierarchy and product attributes (for layered navigation) so requests made to a category or product page load much quicker since they do not invoke the database. This is also beneficial for storefronts with high amounts of web traffic, as requests are handled quicker by the webserver, which in turn enables your store to handle traffic spikes seamlessly.”
DJ: “I can imagine though, there are some situations in which you don’t want all information cached. Is this true? “
RM: “There are also situations in which it would be better to have Magento Cache disabled. These usually arise during the development of your site, when working with the catalog and products. Since Magento Cache works on the category hierarchy and product attributes, you would want to disable it while working in these areas (or while updating products and inventory on a live storefront) to help you validate changes are taking correctly. This also holds true with CMS pages and CMS blocks.”
Caching is an important element of scaling your site to handle an increased volume of visitors. But you need to implement this with care and planning to take into account how processes like catalog refreshes triggered y Magento Integration to your ERP system will impact this. In addition, leveraging larges amount of caching generally requires increased amounts of memory, so be sure your server is sufficient to take advantage of this feature.
Here are few developer tips/info for Magento cache:
- Enable memcache in Magento – http://blog.nexcess.net/2010/03/22/enabling-memcached-in-magento/
- Developing modules with Full Page Cache – http://oggettoweb.com/blog/customizations-compatible-magento-full-page-cache/
- Demystifying Magento cache in the code – http://blog.kyp.fr/make-a-clean-sweep-of-commons-magento-cache_lifetime-workarounds-usage-in-cache-block-policy/#.USaq6qWR_CJ