As magento1.9.2 is added cachetags function in to construct
functon i must have to give seperate cachetags for each block element because its get conflict with varnish to read key. i have solved this issue in.phtml file to set key like below
$this->getLayout()->createBlock('cms/block','',
array(
'cache_lifetime' => false,
'cache_tags' => array(Mage_Cms_Model_Block::CACHE_TAG."_twocmspages")
))->setBlockId("twocmspages")->toHtml();
but if need to assign same cache_tags
using xml with setMethod
how can i do this.
<block type="cms/block" name="block_id">
... set cachetag here
</block>
Is any one has idea how to add cache_tag array
arrgument from XML ?
your help will be appreciated here.
Best Answer
Arguments in
<action>
can be defined as nested elements and will be converted to array:It should be noted that
<tag1>
and<tag2>
will be the array keys, so you cannot use the same tag name and you cannot pass arrays with numeric indexes because XML tags cannot be numbers.A more flexible solution is using JSON. Just specify which argument should be parsed as JSON with the
json
attribute of<action>
: