Forums / Developer / Best way : view cache and set-block

Best way : view cache and set-block

Author Message

Maxime Thomas

Wednesday 02 September 2009 2:20:09 am

Hi,

I'm facing a kind of dilemma and would like to have your advice :

We have a homepage in the content structure wich is fetching some content in the media structure. The problem is that when we add some content, the homepage does not take it in account and we have to clean the caches.

My first option was to use the smart view cache system but it can't be applied for content in differents subtrees.

The second point is to put a set-block with a ttl to 0 at the top of the template and set a huge cache block for the homepage content excepted for the content fetch.

Is there another track to follow ?

Maxime

Maxime Thomas
[email protected] | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

Xavier Serna

Wednesday 02 September 2009 4:24:33 am

I'ts better to use smart viewcache mechanism for doing the trick. You can set it up so everytime objects of certain classes are published, the home page object is cleaned.
Check this: http://ez.no/doc/ez_publish/technical_manual/4_x/reference/configuration_files/viewcache_ini/class_identifier/additionalobjectids

hth!

--
Xavier Serna
eZ Publish Certified Developer
Departament de Software
Microblau S.L. - http://www.microblau.net
+34 937 466 205

Gaetano Giunta

Wednesday 02 September 2009 5:05:03 am

Surely more work, but I was thinking also about a custom workflow event to expire given nodes caches at the time you desire...

Principal Consultant International Business
Member of the Community Project Board

Xavier Serna

Wednesday 02 September 2009 6:14:11 am

Certainly this would be more polite and flexible to do the trick. Just to take in care cost/benefit rate to choose the right solution :)

regards!

--
Xavier Serna
eZ Publish Certified Developer
Departament de Software
Microblau S.L. - http://www.microblau.net
+34 937 466 205

Maxime Thomas

Wednesday 02 September 2009 7:20:46 am

Thank you for the responses.
We won't do the custom workflow event, it seems to be too complex compared to the customer need...
But a great improvement for eZPublish.

Maxime Thomas
[email protected] | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

Ivo Lukac

Wednesday 02 September 2009 9:38:51 am

You can set ttl to 300 (5 minutes) for example so your frontpage will update for sure in defined interval and serve most times cached result

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac