Share » Forums » Setup & design » Random and cache...

Random and cache...

Random and cache...

Tuesday 03 July 2007 7:59:45 am - 6 replies

Modified on Tuesday 03 July 2007 8:02:37 am by Kristoffer Karlsson

Author Message

André R.

Tuesday 03 July 2007 9:24:24 am

Several issues:
first: from the cache-block expiry doc: 'A value of zero will produce a cache block that will never expire.'
second : {set-block scope=root variable=cache_ttl... should be in the top
third: the blocks are in wrong order, the ending of the cache block should be after the ending of the div
fourth: why are you using cache block when you don't want it to cache it ?

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

André R.

Tuesday 03 July 2007 9:27:01 am

And, this template is not a node template is it?
if it is included in another template (either as template include or as embed object) you also have to set cache_ttl on that template

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

Marco Zinn

Tuesday 03 July 2007 9:39:36 am

Hi,

please check these things:

1. Your foreach loop overlaps the cache-block boundaries. Please move the end of the foreach to withing the cache-block
2. {set-block scope=root variable=cache_ttl}0{/set-block} will set the Time To Live of the Content Cache for this node to 0, disabeling the cache. This should be the right way to do this. I had to use "scope=global" once to get it working, but i think, i had used an include file then.
3. {cache-block expiry=0} Means, that you define a cache-block around your output, which will last forever (99% sure, please check the docs on "cache-block"). You should remove this cache-block or set the expiry time to something usefull. Default is "2 hours", i think, maybe try expiry=30 , which means 30 seconds.

For testing, i'd recommend to remove the cache-block statements.

EDIT: :) I was on the phone, while i wrote this comment. I didn't want to duplicate André's entry, they just "overlapped in time" ;)

Marco
http://www.hyperroad-design.com

Kristoffer Karlsson

Thursday 05 July 2007 7:23:29 am

Thanks for your trying to help me.

I have moved the {set-block scope=root variable=cache_ttl}0{/set-block} to the top of the template and removed the cache-blocks.

It now works if I disable view-caching. If I turn it on I get the same article every time.

The code I posted is from the template horizontally_listed_subitems. I also added {set-block scope=root variable=cache_ttl}0{/set-block} to the pagelayout.tpl and the article-line.tpl, but with no result.

I am a beginner to ez and I am really greatful for your help.

_____________________________________
Blog: http://www.kristofferkarlsson.com
Website: http://www.spelkanalen.com

André R.

Thursday 05 July 2007 7:54:04 am

moving it to pagelayout does not help, cause pagelayout and it's included templates are not in the content view (its the stuff that surrounds it and makes out the layout).

So try setting scope=global instead in the original template like Marco mentioned.

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

Kristoffer Karlsson

Thursday 05 July 2007 11:39:33 pm

YES!!

It works. Thanks a lot for your help!

_____________________________________
Blog: http://www.kristofferkarlsson.com
Website: http://www.spelkanalen.com

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu