I need some help on caching issue in CMS block.
I have developed a new product slider for store front that displays latest products in the home page this works great when cache is disabled but when i enable the cache add to cart button is not working, as all the formkey is cached in the block. (P.s. Magento FPC and compilation are enabled)
The widget config as:
{{widget type="catalog/product_widget_new" display_type="all_products" show_pager="1" products_per_page="5000" products_count="5000" template="catalog/product/widget/new/content/new_grid.phtml"}}
Then I include it in the home page like:
<block type="wrapper" name="section.no1">
<action method="setContainer">
<container>1</container>
</action>
<block type="cms/block" name="best_deals" >
<action method="setParams">
<params>class="best_deals"</params>
</action>
<action method="setBlockId">
<block_id>best_deals</block_id>
</action>
</block>
I have tried..
<action method="setCacheLifetime"><s>0</s></action>
and
<action method="setCacheLifetime"><s>null</s></action>
even..
<action method="unsetData"><key>cache_lifetime</key></action>
<action method="unsetData"><key>cache_tags</key></action>
None of them take effect. Perhaps I'm missing something?
Update: I solved the issue by adding $this->setCacheKey(uniqid()); to my template file.