Failed to prevent Magento from block caching

I am working on a Magento 1.6 site that has the following xml inside the CMS field "XML Update Layout" on the home page:

<reference name="content">
   <block type="catalog/navigation" name="catalog.category.home" as="homecategory" template="catalog/category/homecategory.phtml" />
</reference>

Since the template shows randomized categories, I would like to disable caching for this block. For this, I tried to use getChildHtml ("sub-block-template", false) with the following:

(homecategory has $ this-> getChildHtml ('random_categories', false) in its template)

<reference name="content">
    <block type="catalog/navigation" name="catalog.category.home" as="homecategory" useCache="false" template="catalog/category/homecategory.phtml">
        <block type="catalog/navigation" name="catalog.category.home.randcats" as="random_categories"  useCache="false" template="catalog/category/random.phtml" />
    </block>
</reference>

So now I am stuck wondering why I cannot prevent this block from being cached despite using the false argument.

+5
source share
2 answers

? Mage_Catalog_Block_Product_List_Random :

protected function _construct() {}

-, -. -, ( ) . :

public function getCacheKeyInfo()
{
    return array(
        'MY_CACHE_TAG',
        Mage::app()->getStore()->getId(),
        (int)Mage::app()->getStore()->isCurrentlySecure(),
        Mage::getDesign()->getPackageName(),
        Mage::getDesign()->getTheme('template')
    );
}
+3

. , - type = "catalog/navigation". . :

phtml: ,

echo $this->getChildHtml('topCategoriesList',false);

xml:

<block type="catalog/navigation" name="topCategoriesList" as="topCategoriesList"    template="catalog/navigation/categorylist.phtml">
   <action method="unsetData"><key>cache_lifetime</key></action>
   <action method="unsetData"><key>cache_tags</key></action>
</block>
+5

All Articles