In order to improve the performance speed of Magento ® it is necessary to enable caching. Generally, this procedure takes quite a long time for programmers and administrators however Magento ® Enterprise uses Full Page Cache system.
Which we will review in this article.
Why Full Page Cache is needed
Full Page Cache is a specific system of site pages caching which helps the server to load pages within a very short time (milliseconds). The server load is very low in this case, which is a significant advantage in comparison with standard caching systems.
Full Page Cache system caches the whole page of your site. However, not all pages are cached. This helps to save a lot of time as not every part of the site must be cached. By default, caching is only done for product pages, category pages, CMS pages and 404 error links.
Please pay attention to the configuration file where the following part of code is responsible for the cached pages:
<frontend> <cache> <requests> <_no_route>enterprise_pagecache/processor_noroute</_no_route> <cms>enterprise_pagecache/processor_default</cms> <catalog> <category> <view>enterprise_pagecache/processor_category</view> </category> </catalog> <catalog> <product> <view>enterprise_pagecache/processor_product</view> </product> </catalog> </requests> </cache> </frontend>
But there are certain pages which are not cached by Full Page Cache. These include HTTPS pages and their variants with GET-parameter no_cache.
How FPC works
If you enable Full Page Cache all standard caching blocks and corresponding extensions for Magento ® are disabled automatically. At the moment FPC is launched the event controller_action_predispatch is performed.
/** * Check when cache should be disabled * * @param Varien_Event_Observer $observer * @return Enterprise_PageCache_Model_Observer */ public function processPreDispatch(Varien_Event_Observer $observer) { if (!$this->isCacheEnabled()) { return $this; } $action = $observer->getEvent()->getControllerAction(); /* @var $request Mage_Core_Controller_Request_Http */ $request = $action->getRequest(); $noCache = $this->_getCookie()->get(Enterprise_PageCache_Model_Processor::NO_CACHE _COOKIE); if ($noCache) { Mage::getSingleton('catalog/session')->setParamsMemorizeDisabled(false); $this->_getCookie()->renew(Enterprise_PageCache_Model_Processor::NO_CACHE_COOKIE); } elseif ($action) { Mage::getSingleton('catalog/session')->setParamsMemorizeDisabled(true); } /** * Check if request will be cached */ if ($this->_processor->canProcessRequest($request)) { Mage::app()->getCacheInstance()->banUse(Mage_Core_Block_Abstract::CACHE_GROUP); } $this->_getCookie()->updateCustomerCookies(); return $this; }
During the work of Full Page Cache, each separate query receives its own identification number. The number depends on the group(s) to which a customer belongs, whether a user is authorized or not, etc.
Another peculiarity is that Full Page Cache uses so-called placeholders. In Magento ® they are added using the configuration file cache.xml in the module folder called ‘etc’. Each placeholder is processed by the container.
Full Page Cache is indeed very efficient and works perfectly reducing the server load and ensuring that your web store will work fast even when there is a high visitor volume. If you have any additional questions regarding FPC functionality please feel free to contact GoMage experts and request assistance.