title: How to implement magento cache hole punching for shopping cart block
body: <p>Im using Magento EE version 1.12 with Full page cache enabled </p>
  
  <p>a) my product detail page is cached 
  b) as a result my shopping cart in this page doesn't show dynamic item count 
  c) so i am not able to show valid cart item count in my product detail page  </p>
  
  <p>steps i followed </p>
  
  <p>1) I created a block and called from header.phtml 
  2) trying to make that topcart.phtml block not to be cached </p>
  
  <p>As im a newbie in magento , i got some links for cache hole punching </p>
  
  <p>I followed below links but no success</p>
  
  <p>my file structure </p>
  
  <p>app- code - local - Enterprise - PageCache ->etc - cache.xml </p>
  
  <p>and PageCache - model -container - TopCart.php  </p>
  
  <p>code as shown below</p>
  
  <p><a href="https://stackoverflow.com/questions/12948235/hole-punching-mage-catalog-block-product-price-in-magento-ee-fpc">help link one</a></p>
  
  <p><a href="https://stackoverflow.com/questions/9147120/unable-to-prevent-magento-from-caching-a-block">help link two </a></p>
  
  <p><a href="https://stackoverflow.com/questions/8126548/trying-get-dynamic-content-hole-punched-through-magentos-full-page-cache">link three</a></p>
  
  <p>i created files 
  cache.xml and cart.php container file </p>
  
  <pre><code> &lt;page_html_topcart&gt;
          &lt;block&gt;page/html_topcart&lt;/block&gt;
          &lt;name&gt;topcart&lt;/name&gt;
          &lt;placeholder&gt;PAGE_HTML_HEADER_CART&lt;/placeholder&gt;
          &lt;container&gt;Enterprise_PageCache_Model_Container_TopCart&lt;/container&gt;
          &lt;cache_lifetime&gt;36400&lt;/cache_lifetime&gt;
      &lt;/page_html_topcart&gt;
  </code></pre>
  
  <p>this is my topcart.php container file looks like</p>
  
  <pre><code>  protected function _getIdentifier()
  {
      $cacheId = $this-&gt;_getCookieValue(Enterprise_PageCache_Model_Cookie::COOKIE_CUSTOMER, '')
          . '_'
          . $this-&gt;_getCookieValue(Enterprise_PageCache_Model_Cookie::COOKIE_CUSTOMER_LOGGED_IN, '');
  
      return $cacheId;
  }
  
   protected function _getCacheId()
  {
      return 'CONTAINER_TOPCART_' . md5($this-&gt;_placeholder-&gt;getAttribute('cache_id') . $this-&gt;_getIdentifier());
  }
  
  protected function _renderBlock()
  {
      $block = $this-&gt;_getPlaceHolderBlock(); //('page/html_header_cart');
      Mage::dispatchEvent('render_block', array('block' =&gt; $block, 'placeholder' =&gt; $this-&gt;_placeholder));
      return $block-&gt;toHtml();
  }
  </code></pre>
  
  <p>kindly help me out with useful links and step</p>