Forums / Developer / shuffle and cache, please help!

shuffle and cache, please help!

Author Message

Jorge estévez

Tuesday 23 December 2008 11:38:10 am

Hello!

What if I wanted all my templates compiled and one of them parsed always, is this possible? Is there a way to specify such request?. I need to parse a template because it fetches a random value with shuffle!, and shuffle wont work when I specify cache enabled for everything.

I have tryed {set-block scope=root variable=cache_ttl}0{/set-block} at the top of the template that uses shuffle op. but it does not work...

please help! Thanks

Diseño Web Cuba
Web Design Cuba
www.elfosdesign.com

André R.

Tuesday 23 December 2008 1:52:01 pm

set scope=global instead.

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

Jorge estévez

Tuesday 23 December 2008 3:05:01 pm

Thanks, Ive beein trying to solve this issue for quite a while. It's the only thing to solve before the site goes online.

I changed to scope=global and nothing happened, keep showing the same data. I clerared the caches, one by one and all, I also used ezclearcache.php to clear all nodes...

Once I clear caches the data chages only once, then it keeps showing the same values (as if caches of all templates including the one I need o parse always)

I used:

{set-block scope=global variable=cache_ttl}0{/set-block}

I assume It caches all templates and shuffle Op. does not work at all...

Any other idea!

thanks

Diseño Web Cuba
Web Design Cuba
www.elfosdesign.com

André R.

Wednesday 24 December 2008 1:50:27 am

And if you clear the caches one by one using the checkboxes in admin, witch ones fixes it for a moment?

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

Jorge estévez

Wednesday 24 December 2008 2:54:09 pm

Hello and thanks again.

Template cache cleaning is the only one that makes my random images change...

Diseño Web Cuba
Web Design Cuba
www.elfosdesign.com

Caroline Condamin

Wednesday 14 January 2009 9:16:33 am

Hi everybody,

I have exactly the same problem as Jorge.

Maybe there is a php function that clears Template cache each time you load your page?

Does somebody know about that?

thanks!

Ciji

Jorge estévez

Thursday 15 January 2009 3:35:40 am

hi!

Still no solution for me...

any help!

Diseño Web Cuba
Web Design Cuba
www.elfosdesign.com

Pablo Pernot

Friday 27 February 2009 6:57:59 am

I got exactly the same behavior, no idea ?

version 4.0.1

Pablo Pernot
http://www.smartview.fr
http://www.areyouagile.com

André R.

Friday 27 February 2009 7:50:50 am

1. Why don't you guys use the rand operator instead, its really simple and you don't end up killing your database bye fetching all node / objects just to shuffle them around in php memory..

example:

{def $max = fetch('content', 'tree_count', hash('parent_node_id', 175))|dec}
      $random_project=fetch('content', 'tree', hash('parent_node_id', 175, 'offset', rand( 0,$max ), 'limit', 1))}

2. Don't expect this to show different content every second and still perform decently, think smart about your cache strategy. But if you really want to get it to change all the time, place it in pagelayout outside any of the cache-blocks (thats better for performance then disabling view-cache)

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

Pablo Pernot

Friday 27 February 2009 8:14:23 am

Just post another topic to specified my config (I haven't seen your reply...). I'm using the rand operator. And yes you're right, as soon as the set-block error is solved I'll probably set it up to few seconds.

http://ez.no/developer/forum/developer/set_block_no_cache_won_t_work

Pablo Pernot
http://www.smartview.fr
http://www.areyouagile.com

Fátima Chapri

Sunday 01 March 2009 2:05:09 am

I had the same problem with the shuffle operator. It was also working in conflict with an other extension i created, so I had to disable the shuffle extension and use the rand() operator.

But my rand list only changes when I clean the cache.

Specifications:
- Ez Publish 3.9
- All the cache blocks are desactivated

Any ideas?