Understanding Magento Enterprise Full Page Cache
Full Page Cache is a Magento Enterprise feature that allows for storing most content of a page in a super fast cache while still allowing for dynamic page elements (e.g. adding something to cart will invalidate the header section to reflect your new cart quantity). Full Page Cache provides a huge performance boost for Magento Enterprise and is a must have for high traffic sites.
If you have a very high traffic site and need to make changes to your site throughout the day you may run into problems. As some changes are made to a site, you may need to reload the Full Page Cache. Reloading the FPC wipes out cached versions of all pages and can cause heavy strain on a server as many uncached pages are loaded and saved in the cache. By understanding how the Magento Enterprise Full Page works you can make sure you won't hurt your server by unnecessary reloads.
A common question is how will the FPC respond to different changes in the admin? Some store owners make changes and then wipe out the cache as a habit, but this may not be needed or may be dangerous. Magento tries to selectively clear the FPC when entities are edited so only the affected portions of the cache are removed. Since this is still work in progress (as of Magento EE 1.12), some changes will appear in the frontend without clearing the cache while some won't.
The purpose of this article is to offer a full report on what is safe to edit in Magento Enterprise without refreshing the cache and/or issuing a reindex.
First of all it's important to mention that Full Page Cache is only applicable to category pages, product detail pages and CMS pages. We've tested these separate page types below and what happens when we don't reload the Full Page Cache:
- if adding new categories / products / CMS pages are displayed
- if edits to categories / products/ CMS pages are displayed
- if deleting categories / products / CMS pages makes them disappear
All the tests were performed on the default Magento theme. If you have theme customizations, the results may differ as custom blocks need to inform Magento when they should be cleaned from the cache. It is a common problem for customizations not being "full page cache ready", but this issue is outside the scope of this article.
Let's start with the Category table: we did some tests to see if it's safe to add / edit / delete a category without clearing the cache and if that category will be displayed in the top menu and/or by simply putting the URL in the browser. All actions turned out to be unsafe, the user has to clear cache after each modification to be able to see it. However there is an exception. For example, if the user creates a category, he is able to see it in the top menu from another category page, but not from Homepage. The same thing happens when the user deletes a category; the deleted category is still displayed in the top menu on Homepage, but does not appear if the user is located on another category page.
Category | Add New | Edit | Delete |
---|---|---|---|
Top Menu Visibility | need reload | need reload | need reload |
Category Page Visibility | need reload | need reload | need reload |
As for products, in the following table you will see that it is safe to add and edit a product without clearing cache and the changes will be displayed. But after you delete a product, you have to clear cache, otherwise the product will still be there. We also did another test with low quantity products. We purchased the whole amount (qty = 0 / Out of Stock in the admin) and tried to purchase the same product again. We didn't clear cache. The product was still displayed and showed In Stock label, but when we tried to purchase it, a warning message was shown saying the the product was Out of Stock.
Product | Add New | Edit | Delete |
---|---|---|---|
Category Page | safe | safe | need reload |
Product Detail | safe | safe | need reload |
The following table shows you that only adding a new CMS page is safe. The CMS page can be open by accessing the URL, but the changes are not shown when you edit or delete it, unless you clear the cache.
CMS Page | Add New | Edit | Delete |
---|---|---|---|
Detail Page | safe | need reload | need reload |
Tags: