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

Full Page Cache: Enterprise PageCache Model Config

How to work/flow Enterprise_PageCache_Model_Config class in Magento? (Magento EE 1.13.0.2)

Object: $this => Enterprise_PageCache_Model_Config

Following constants is used in above class: no variables

Following variables is used in above class:

  • $_placeholders

Some important functions and their purpose used in this class:

  • initPlaceholders(): This function initialized all declared placeholders as array.
  • getDeclaredPlaceholders(): Retrieve all declared placeholders as array.
  • getBlockPlaceholder(): This function is used to create placeholder object based on block information.

Functions in class Enterprise_PageCache_Model_Config

  • /**
    * Class constructor
    * load cache configuration
    *
    * @param $data
    */
    public function __construct($data = null)
    {
    }
  • /**
    * Initialize all declared placeholders as array
    * @return Enterprise_PageCache_Model_Config
    */
    protected function _initPlaceholders()
    {
    if ($this->_placeholders === null) {
    $this->_placeholders = array();
    foreach ($this->getNode(‘placeholders’)->children() as $placeholder)
    {
    $this->_placeholders[(string)$placeholder->block][] = array(
    ‘container’=> (string)$placeholder->container,
    ‘code’ => (string)$placeholder->placeholder,
    ‘cache_lifetime’=> (int) $placeholder->cache_lifetime,
    ‘name’=> (string) $placeholder->name
    );
    }
    }
    return $this;
    }
  • /**
    * Retrieve all declared placeholders as array
    *
    * @return array
    */
    public function getDeclaredPlaceholders()
    {
    $this->_initPlaceholders();
    return $this->_placeholders;
    }
  • /**
    * Create placeholder object based on block information
    *
    * @param Mage_Core_Block_Abstract $block
    * @return Enterprise_PageCache_Model_Container_Placeholder
    */
    public function getBlockPlaceholder($block)
    {
    }

Variation of sample data for different pages (Homepage, Product Listing Page, Product Info Page)
Variables: These values for Homepage :
URL : https://localhost/oscp-store/magento_enterprise/

$_placeholders =>array[19]

  • reports/product_viewed = array[1] [0] = array[4] container = Enterprise_PageCache_Model_Container_Viewedproducts
    code = VIEWED_PRODUCTS
    cache_lifetime = 86400
    name = “”
  • reports/product_widget_viewed = array[1] [0] = array[4] container = Enterprise_PageCache_Model_Container_Viewedproducts
    code = VIEWED_PRODUCTS
    cache_lifetime = 86400
    name = “”
  • page/html_topmenu = array[1] [0] = array[4] container = Enterprise_PageCache_Model_Container_Catalognavigation
    code = TOPMENU
    cache_lifetime = 86400
    name = “catalog.topnav”
  • page/html_topmenu = array[1] [0] = array[4] container = Enterprise_PageCache_Model_Container_Catalognavigation
    code = TOPMENU
    cache_lifetime = 86400
    name = “catalog.topnav”
  • heckout/cart_sidebar = array[1] [0] = array[4] container = Enterprise_PageCache_Model_Container_Sidebar_Cart
    code = CART_SIDEBAR
    cache_lifetime = 86400
    name = “
  • catalog/product_compare_sidebar = array[1] [0] = array[4] container = Enterprise_PageCache_Model_Container_Sidebar_Comparelist
    code = COMPARELIST_SIDEBAR
    cache_lifetime = 86400
    name = “
  • core/messages = array[2] [0] = array[4] container = Enterprise_PageCache_Model_Container_Messages
    code = MESSAGES
    cache_lifetime = 86400
    name = “messages”[1] = array[4] container = Enterprise_PageCache_Model_Container_Messages
    code = GLOBAL_MESSAGES
    cache_lifetime = 86400
    name = “global_messages”
  • reports/product_compared = array[1] [0] = array[4] container = Enterprise_PageCache_Model_Container_Sidebar_Recentlycompared
    code = RECENTLYCOMPARED_SIDEBAR
    cache_lifetime = 86400
    name = “”
  • reports/product_compared = array[1] [0] = array[4] container = Enterprise_PageCache_Model_Container_Sidebar_Recentlycompared
    code = RECENTLYCOMPARED_SIDEBAR
    cache_lifetime = 86400
    name = “”
  • page/html_welcome = array[1] [0] = array[4] container = Enterprise_PageCache_Model_Container_Welcome
    code = WELCOME
    cache_lifetime = 86400
    name = “”
  • page/template_links = array[1] [0] = array[4] container = Enterprise_PageCache_Model_Container_Accountlinks
    code = ACCLINKS
    cache_lifetime = 86400
    name = “account.links”
  • enterprise_wishlist/customer_sidebar = array[1] [0] = array[4] container = Enterprise_PageCache_Model_Container_Wishlist
    code = WISHLIST
    cache_lifetime = 86400
    name = “”
  • sales/reorder_sidebar = array[1] [0] = array[4] container = Enterprise_PageCache_Model_Container_Orders
    code = ORDERS
    cache_lifetime = 86400
    name = “”
  • enterprise_wishlist/links = array[1] [0] = array[4] container = Enterprise_PageCache_Model_Container_Wishlistlinks
    code = WISHLISTLINKS
    cache_lifetime = 86400
    name = “”
  • poll/activePoll = array[1] [0] = array[4] container = Enterprise_PageCache_Model_Container_Sidebar_Poll
    code = POLL
    cache_lifetime = 86400
    name = “”
  • enterprise_banner/widget_banner = array[1] [0] = array[4] container = Enterprise_PageCache_Model_Container_Banner
    code = WIDGET_ENTERPRISE_BANNER
    cache_lifetime = 86400
    name = “”
  • nterprise_targetrule/catalog_product_item = array[2] [0] = array[4] container = Enterprise_PageCache_Model_Container_CatalogProductItem
    code = CATALOG_PRODUCT_ITEM_RELATED
    cache_lifetime = 86400
    name = “catalog.product.related.item”[1] = array[4] container = Enterprise_PageCache_Model_Container_CatalogProductItem
    code = CATALOG_PRODUCT_ITEM_UPSELL
    cache_lifetime = 86400
    name = “catalog.product.upsell.item”
  • enterprise_giftcard/catalog_product_view_type_giftcard_form = array[1] [0] = array[4] container = Enterprise_PageCache_Model_Container_Giftcard
    code = GIFTCARD
    cache_lifetime = 86400
    name = “product.info.giftcard.form”
  • catalog/product_list_related = array[1] [0] = array[4] container = Enterprise_PageCache_Model_Container_CatalogProductList
    code = CATALOG_PRODUCT_LIST_RELATED
    cache_lifetime = 86400
    name = “catalog.product.related”
  • catalog/product_list_upsell = array[1] [0] = array[4] container = Enterprise_PageCache_Model_Container_CatalogProductList
    code = CATALOG_PRODUCT_LIST_UPSELL
    cache_lifetime = 86400
    name = “product.info.upsell”
  • enterprise_wishlist/behaviour = array[1] [0] = array[4] container = Enterprise_PageCache_Model_Container_Wishlists
    code = WISHLISTS
    cache_lifetime = 86400
    name = “”

Variables: Gives same output for Product Listing and Product View Page
Note: $_placeholders gives list of all placeholders for all page (Homepage, Product Listing and Product View Page) and also when logged-in.

Leave A Comment