This site has been archived. To learn more about our current products Ibexa Content, Ibexa Experience, Ibexa Commerce head over to the Ibexa Developer Portal

eZ Community » Forums » eZ Publish 5 Platform » Dynamic SF2 part in a cached legacy...

Dynamic SF2 part in a cached legacy full view

Dynamic SF2 part in a cached legacy full view

Thursday 12 February 2015 3:14:19 pm - 8 replies

Hello all,

I have a quite specific question about legayc, cache and stuff :

  • I have a siteaccess running in legacy_mode
  • A view full use a template operator, this operator calls a SF2 service
  • This operator display a COUNT from a custom table in db
  • The count result change often

The problem : the rendering of this operator change only if the cache is cleared. I would need to execute the COUNT on every display.

What would be the best practice to do so ?

Thank you very much

Thursday 12 February 2015 9:34:03 pm

This is something you would then need to tweak in legacy, just like dynamic content in cache area in pure legacy.

Thursday 12 February 2015 9:42:56 pm

Agree with André. Your problem is not calling a sf2 service but maybe viewcache is caching what it gets from the service. So you maybe need set ttl to to that tpl.

Friday 13 February 2015 10:43:17 am

Hello André and Carlos,

Thank you for your answers.

Do you mean using : {set-block scope=root variable=cache_ttl}0{/set-block} ?

The point is I need to cache this full view. It is the main content of the website.

Friday 13 February 2015 10:47:41 am

and can't you refactor your tpl somehow so maybe you can move that part to your pagelayout.tpl? 

Friday 13 February 2015 12:20:23 pm

Sadly no. This info is directly linked to the node and we can't split the interface.

I am sure there is a way to do so. I will think about it with a full stomach.

If you have any idea about it I would be great. I'll post here if I find a solution

Friday 13 February 2015 12:30:00 pm

Well, one option could be use

But honestly, i never tried it. This is one of great adventages we have now with sf stack. If i were you i try to switch that part to it as soon as possible. happy.gif Emoticon

Other option can be add ttl 0 as you say and play with cache-blocks, but not very elegant imho.  

Edit: Btw, this is one of the things i always thought to implement in the old legacy stack, but our eZ Crew friends told me to even not trying it because is not possible. 

Modified on Friday 13 February 2015 12:32:01 pm by Carlos Revillo

Friday 13 February 2015 2:00:24 pm

Hello Paul,

Your issue is solely a legacy based problem.

I think your use case has been well provided for at least in eztpl happy.gif Emoticon

What you need to do is use template code to do the following:

  • Disable cache for this template
  • Use cache blocks to cache the contents of the template (your fetch, results display, etc) in two blocks (at least, above and bellow your dynamic value)

The above will provide you with a solution which is both cached (faster; to cache your fetch, results, etc), flexible and dynamic.

This topic has come up recently and was discussed in detail,

You also could if you prefer consider an ajax based solution using ezjscore.

I hope this helps!


Friday 13 February 2015 6:13:14 pm

Thank you for your help guys.

I have used a bazooka to kill this mosquito :


Quick and drity.

Thank you again for the help, it is great.


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

36 542 Users on board!

Forums menu

Proudly Developed with from