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
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

eZ debug

Timing: Jan 18 2025 03:10:34
Script start
Timing: Jan 18 2025 03:10:34
Module start 'content'
Timing: Jan 18 2025 03:10:35
Module end 'content'
Timing: Jan 18 2025 03:10:35
Script end

Main resources:

Total runtime0.7314 sec
Peak memory usage4,096.0000 KB
Database Queries207

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 590.9141180.8281
Module start 'content' 0.00660.5977 771.7422673.8438
Module end 'content' 0.60430.1270 1,445.5859341.0547
Script end 0.7313  1,786.6406 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.5287210.0002
Check MTime0.00140.1975210.0001
Mysql Total
Database connection0.00080.104310.0008
Mysqli_queries0.659290.12832070.0032
Looping result0.00180.24052050.0000
Template Total0.704196.320.3521
Template load0.00200.278020.0010
Template processing0.702195.993420.3510
Template load and register function0.00010.014810.0001
states
state_id_array0.00110.150310.0011
state_identifier_array0.00070.097920.0004
Override
Cache load0.00170.2307310.0001
Sytem overhead
Fetch class attribute can translate value0.00100.136550.0002
Fetch class attribute name0.00080.1098100.0001
XML
Image XML parsing0.00220.296850.0004
class_abstraction
Instantiating content class attribute0.00000.0022120.0000
General
dbfile0.00530.7257460.0001
String conversion0.00000.000730.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs