I have setup a custom module and block with a very short Full Page Cache lifetime. Inside that block I am calling Banners (an Enterprise feature.) These Banners are returned the first time the Full Page Cache is created, but not when it's refreshed a few seconds later.

How can I get the output of Banner blocks (powered by Widgets) to not cache. (See the bottom of this page for more details on the current outcome of the following code.)


<?xml version="1.0"?>


<?xml version="1.0"?>


class Mycompany_FpcBlocks_Helper_Data extends Mage_Core_Helper_Abstract {}



class Mycompany_FpcBlocks_Model_Container_Homepage extends Enterprise_PageCache_Model_Container_Abstract
    protected function _getCacheId()
        return 'MYCOMPANY_FPCBLOCKS_HOMEPAGE_CACHE' . md5($this->_placeholder->getAttribute('cache_id')) . '_' . $this->_getCookieValue(Enterprise_PageCache_Model_Cookie::COOKIE_CUSTOMER, '');

    protected function _renderBlock()
        $blockClass = $this->_placeholder->getAttribute('block');;
        $template = $this->_placeholder->getAttribute('template');

        /** @var Mycompany_FpcBlocks_Block_Homepage $block */
        $block = new $blockClass;

        return $block->toHtml();



class Mycompany_FpcBlocks_Block_Homepage extends Mage_Core_Block_Template
    protected function _construct()

    public function getDate()
        return date('F d Y, h:i:s a');

app/design/frontend/mytheme/default/layout/page.xml - Inside default/root

<block type="fpcblocks/homepage" name="mycompany.fpc.homepage">
    <label>Mycompany FPC - Homepage</label>
    <block type="core/text_list" name="banner_block_1" as="banner_block_1">
        <label>Homepage Banner</label>


echo '<pre>';
echo 'This block was generated on '.$this->getDate()."\n";
var_dump(htmlspecialchars(trim($this->getChildHtml('banner_block_1', false))));
echo '</pre>';

The current result:

  • Without Full Page Cache turned on, this outputs the correct time, and the content of the banner.
  • Right after turning Full Page Cache on, this still outputs the correct time, and the content of the banner.
  • After refreshing the page once, (technically I think this is after the 3 seconds from cache.xml) this still outputs the correct time (IE: it doesn't get cached) but now the call to $this->getChildHtml('banner_block_1') comes back blank.


I've gone into core_layout_update and found the XML for this banner, and manually added this inside the <block> tag:

<action method="unsetData"><key>cache_lifetime</key></action>
<action method="unsetData"><key>cache_tags</key></action>

This has no affect.

  • Any luck with it? I am having same blank page problem on reload. Aug 31, 2015 at 4:16

1 Answer 1


First of all you need to keep in mind that when you are in FPC cached page, the block is not getting created via layout. So first time when FPC page gets popuplated getChildHtml() returns you a correct block, but second time, it will not instantiate it, since Layout XML is not applied at all on cached response.

Any block you are referring to within FPC scope, should be created manually without using layout xml, so you can re-use it even, when layout is not available.

As far as I know, banners already FPC compatible, you should take a look into: Enterprise_PageCache_Model_Container_Banner

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.