title: How do I include a dynamic block in the product page with full page caching turned on?
body: <p>We would like to add a dynamic block to the product page.  The problem is that the product page has full page caching (and we cannot turn that off due to speed issues).  We want to display different information on each product page based on the logged in user's account, and it varies from product to product.</p>
  
  <p>I created a separate block that has its own caching, but this displays the same block from the previous product page.  I'm trying to alter it's caching method so it doesn't save the cache from the previous product page.</p>
  
  <p>It works the first few times I go to the product pages, but then suddenly starts displaying a Magento error page that says, "The website encountered an error while retrieving <a href="http://www.mycompany.com/productpage.html" rel="nofollow noreferrer">http://www.mycompany.com/productpage.html</a>.<br>
  It may be down for maintenance or configured incorrectly."</p>
  
  <p>Here is what I've done so far.  </p>
  
  <blockquote>
    <p>I created <strong><code>app/code/local/MyCompany/MyModule/PageCache/etc/config.xml</code></strong> to add <strong>MyCompany_PageCache_Model.</strong></p>
    
    <p>Then I created the file that controls caching in <strong><code>app/code/local/MyCompany/MyModule/PageCache/Model/Container/MyFile.php</code></strong><br>
     with these functions:</p>
  </blockquote>
  
  <pre><code>protected function _getCacheId()
  {
      return 'CONSTANT_CACHE' . md5($this-&gt;_placeholder-&gt;getAttribute('cache_id'));
  }
  
  protected function _saveCache($data, $id, $tags = array(), $lifetime = null)
  {
      return false;
  }
  
  protected function _renderBlock()
  {
      $blockClass = $this-&gt;_placeholder-&gt;getAttribute('block');
      $template = $this-&gt;_placeholder-&gt;getAttribute('template');
  
      $block = new $blockClass;
      $block-&gt;setTemplate($template);
      $block-&gt;setLayout(Mage::app()-&gt;getLayout());
      return $block-&gt;toHtml();
  }
  </code></pre>
  
  <p>I also created <strong>cache.xml</strong> under <strong>Catalog/etc</strong> with my placeholder for <strong>CONSTANT_CACHE.</strong></p>
  
  <p>Is the syntax above incorrect, or is there an easier way to do this?</p>