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
maxime.thomas@wascou.org | 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
maxime.thomas@wascou.org | 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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 05:19:24
Script start
Timing: Jan 18 2025 05:19:24
Module start 'layout'
Timing: Jan 18 2025 05:19:24
Module start 'content'
Timing: Jan 18 2025 05:19:24
Module end 'content'
Timing: Jan 18 2025 05:19:24
Script end

Main resources:

Total runtime0.9894 sec
Peak memory usage4,096.0000 KB
Database Queries70

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0091 589.0391152.6250
Module start 'layout' 0.00910.0035 741.664139.4609
Module start 'content' 0.01260.9747 781.1250668.7656
Module end 'content' 0.98720.0021 1,449.890616.1563
Script end 0.9894  1,466.0469 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.3821160.0002
Check MTime0.00140.1402160.0001
Mysql Total
Database connection0.00120.119710.0012
Mysqli_queries0.917792.7513700.0131
Looping result0.00070.0700680.0000
Template Total0.956796.720.4783
Template load0.00210.210520.0010
Template processing0.954696.483320.4773
Template load and register function0.00010.014610.0001
states
state_id_array0.00060.065510.0006
state_identifier_array0.00090.095620.0005
Override
Cache load0.00160.1578310.0001
Sytem overhead
Fetch class attribute can translate value0.00100.096740.0002
Fetch class attribute name0.00290.2923100.0003
XML
Image XML parsing0.00220.222740.0006
class_abstraction
Instantiating content class attribute0.00000.0022120.0000
General
dbfile0.00150.1501350.0000
String conversion0.00000.000940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs