Forums / Setup & design / Cache block problem
Andrew White
Tuesday 10 March 2009 8:39:13 am
Afternoon:
I have a script that pulls down an XML feed, formats it, and saves it as a .tpl file. I include that .tpl in another .tpl file. I want that file to be refreshed every two hours. However, its being cached along with everything else. I need help debugging. Think of the structure like this:
script.php -writes-> a.tpl
pagelayout.tpl -includes-> main_area.tpl -calls-> b.tpl -includes-> a.tpl
To include a.tpl, I'm using
{cache-block scope=global expiry=7200} {include uri="design:parts/a.tpl"} {/cache-block}
However, this is not working, the file does not get refreshed. What is wrong with this cache block definition? Where else should I be looking for the caching?
Tero Auralinna
Tuesday 10 March 2009 9:39:31 am
There is no scope parameter in cache-block.
View cache might be a problem as well if a.tpl is included in node view.
NXC Finland - Open Source solutions, Internet marketing and web analytics http://www.nxc.fi http://www.auralinna.fi http://twitter.com/teroauralinna
Tuesday 10 March 2009 9:47:55 am
Thank you, Tero, that was indeed the problem (the view cache, the scope was already out.)
Wednesday 11 March 2009 4:20:13 am
Hmm. I seem to be wrong; its still caching. Does the {set-block scope=global variable=cache_ttl}0{/set-block} need to be in the calling template (b.tpl) or the included template (a.tpl)?
Thanks,a.
Wednesday 11 March 2009 4:21:27 am
I used the following code to disable view caching, btw, is it correct?
{set-block scope=global variable=cache_ttl}0{/set-block}
André R.
Wednesday 11 March 2009 4:35:29 am
yes, if its inside a node template or it's included templates(as in it will have no effect in pagelayout an it's included templates).
eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription @: http://twitter.com/andrerom
Wednesday 11 March 2009 4:59:48 am
Thanks! Looking into it more.