The issue you are facing is the same that Fabrizio explains here:
http://fbrnc.net/blog/2015/06/cache-and-layout-xml-tricks
To paraphrase his blog post, when you are setting the cache lifetime in the xml any of the values that you pass into the node <action method="setCacheLifetime">
will evaluate to true
. Even if you pass null
, that will be converted to a string
, and that string
will be true
. What you have to do is create a helper class that can set the value of null in the node.
Create a blank module and add your config file:
{{site_root}}/app/code/local/{{your_namespace}}/CacheNull/ect/config.xml
<?xml version="1.0"?>
<config>
<modules>
<{{your_namespace}}_CacheNull>
<version>1.0.0</version>
</{{your_namespace}}_CacheNull>
</modules>
<global>
<helpers>
<customcachenull>
<class>{{your_namespace}}_CacheNull_Helper</class>
</customcachenull>
</helpers>
</global>
</config>
Then create your helper class:
{{site_root}}/app/code/local/{{your_namespace}}/CacheNull/Helper/Data.php
class {{your_namespace}}_CacheNull_Helper_Data extends Mage_Core_Helper_Abstract
{
public function returnNull()
{
return null;
}
}
Once you verify that the module is loading correctly on your site, you can add in the needed xml to remove the footer from the cache:
{{site_root}}/app/design/frontend/{{you_theme_namespace}}/{{your_theme}}/layout/local.xml
<reference name="footer">
<action method="setCacheLifetime"><lifetime helper="customcachenull/returnNull" /></action>
</reference>
To check if the footer is in fact not being cached, take another tool from Fabrizio:
https://github.com/AOEpeople/Aoe_TemplateHints
Using this you will be able to see in full color what blocks are being cached as well as a bunch of other useful info about your site's content.