Home » Blogs » Full Page Cache : Enterprise PageCache Model Validator

Full Page Cache : Enterprise PageCache Model Validator

How to work/flow Enterprise_PageCache_Model_Container_Placeholder class in Magento?
(Magento EE 1.13.0.2)
Object: $this => Enterprise_PageCache_Model_Validator

Following constants is used in above class :

  • const XML_PATH_DEPENDENCIES_CHANGE = ‘adminhtml/cache/dependency/change’;
  • const XML_PATH_DEPENDENCIES_DELETE = ‘adminhtml/cache/dependency/delete’;

Following variables is used in above class :

  • Data change dependency :
    protected $_dataChangeDependency = array(
    ‘Mage_Catalog_Model_Product’,
    ‘Mage_Catalog_Model_Category’,
    ‘Mage_Catalog_Model_Resource_Eav_Attribute’,
    ‘Mage_Tag_Model_Tag’,
    ‘Mage_Review_Model_Review’,
    ‘Enterprise_Cms_Model_Hierarchy_Node’,
    ‘Enterprise_Banner_Model_Banner’,
    ‘Mage_Core_Model_Store_Group’,
    ‘Mage_Poll_Model_Poll’,
    );
  • Data delete dependency :
    protected $_dataDeleteDependency = array(
    ‘Mage_Catalog_Model_Category’,
    ‘Mage_Catalog_Model_Resource_Eav_Attribute’,
    ‘Mage_Tag_Model_Tag’,
    ‘Mage_Review_Model_Review’,
    ‘Enterprise_Cms_Model_Hierarchy_Node’,
    ‘Enterprise_Banner_Model_Banner’,
    ‘Mage_Core_Model_Store_Group’,
    ‘Mage_Poll_Model_Poll’,
    );

Functions in class Enterprise_PageCache_Model_Validator
There are 10 functions are present in class Enterprise_PageCache_Model_Validator

  • /**Mark full page cache as invalidated
    * @deprecated after 1.12.0.2 **/
    protected function _invelidateCache(){}
  • /** Mark full page cache as invalidated **/
    protected function _invalidateCache()
    {
    Mage::app()->getCacheInstance()->invalidateType(‘full_page’);
    }
  • /**Get list of all classes related with object instance
    * @param $object * @return array*/
    protected function _getObjectClasses($object){}
  • /**Check if during data change was used some model related with page cache and invalidate cache
    * @param mixed $object
    * @return Enterprise_PageCache_Model_Validator*/
    public function checkDataChange($object){}
  • /**Check if during data delete was used some model related with page cache and invalidate cache*/
    * @param mixed $object
    * @return Enterprise_PageCache_Model_Validator
    public function checkDataDelete($object){}
  • /**Clean cache by entity tags
    * @param Mage_Core_Model_Abstract $object
    * @return Enterprise_PageCache_Model_Validator**/
    public function cleanEntityCache(Mage_Core_Model_Abstract $object) {}
  • /** Retrieves cache instance
    * @return Mage_Core_Model_Cache **/
    protected function _getCacheInstance()
    {
    return Enterprise_PageCache_Model_Cache::getCacheInstance();
    }
  • /**Returns array of data change dependencies from config
    *@return array **/
    protected function _getDataChangeDependencies()
    {
    return $this->_getDataDependencies(self::XML_PATH_DEPENDENCIES_CHANGE);
    }
  • /**Returns array of data delete dependencies from config
    * @return array*/
    protected function _getDataDeleteDependencies()
    {
    return $this->_getDataDependencies(self::XML_PATH_DEPENDENCIES_DELETE);
    }
  • /** Get data dependencies by xpath
    * @param string $xpath * @return array */
    protected function _getDataDependencies($xpath)
    {
    $node = Mage::getConfig()->getNode($xpath);
    return (!$node)? array() : array_values($node->asArray());
    }

Variation of sample data for different pages (Homepage, Product Listing Page, Product Info Page)

Variables: These values for Homepage

URL : https://localhost/oscp-store/mage-ent-test/index.php

  • $_dataChangeDependency = Array [9]0 = Mage_Catalog_Model_Product
    1 = Mage_Catalog_Model_Category
    2 = Mage_Catalog_Model_Resource_Eav_Attribute
    3 = Mage_Tag_Model_Tag
    4 = Mage_Review_Model_Review
    5 = Enterprise_Cms_Model_Hierarchy_Node
    6 = Enterprise_Banner_Model_Banner
    7 = Mage_Core_Model_Store_Group
    8 = Mage_Poll_Model_Poll
  • $_dataDeleteDependency = Array [8]0 = Mage_Catalog_Model_Category
    1 = Mage_Catalog_Model_Resource_Eav_Attribute
    2 = Mage_Tag_Model_Tag
    3 = Mage_Review_Model_Review
    4 = Enterprise_Cms_Model_Hierarchy_Node
    5 = Enterprise_Banner_Model_Banner
    6 = Mage_Core_Model_Store_Group
    7 = Mage_Poll_Model_Poll

Note : It gives same output for Product Listing page and Product Info page

Leave A Comment