Forums / General / Convert - Cache

Convert - Cache

Author Message

John Smith

Friday 05 December 2008 12:56:11 am

Hi there,

Hope someone can help me. Version 4.0.0 - In one of pages I have written a template script to display latest 5 news items (with title, short description and an image) from the NEWS section. Before that script I have disabled the cache with the following line, because when I am uploading an article in the NEWS section, the 5 latest items are not being updated. It is working fine if I write the following code before the script.

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

Yesterday I was checking the performance and time taken to load the page in which the latest 5 news items are being displayed. Every time I refresh the page, I can see CONVERT command being executed. I think this is for the resizing the images in the 5 news items. Is there any way to stop executing CONVERT everytime when somebody loads the page. I know this is because of SET-BLOCK statement, but if I am not writing it, the news items are not getting updated...

All this is not happening in the News section itself.

Please help.

Carlos Revillo

Friday 05 December 2008 1:31:04 am

I think you should define some rules in viewcache.ini.append.php to solve this.

you should delete the {set-block scope=root variable=cache_ttl}0{/set-block} at the top.

and tell ez to clear the cache for this page only if a new is published.

Take a look at http://ez.no/doc/ez_publish/technical_manual/4_0/features/view_caching/smart_view_cache_cleaning

So, you can try something like

[article]
AdditionalObjectIDs[]
AdditionalObjectIDs[]=64

where "article" is the identifier of your "news" class and 64 is the object id of the node where you have that news list.

This way, viewcache for this node will be cleaned only when you publish a new.

Hope it helps.

David Suela

Friday 05 December 2008 1:39:13 am

I think there is a bug in ezpublish 4.0.0 with this (http://issues.ez.no/IssueView.php?Id=12386&activeItem=3). Try to update to 4.0.1, or get the last kernel/classes/datatypes/ezimage/ezimagealiashandler.php

xsto.info <el acceso a la información>
http://xsto.info
http://dominios.coop

Arnaud Lafon

Friday 05 December 2008 1:44:51 am

If you disable content view caching, then you should use the cache-block template function.
There are parameters (subtree_expiry and keys for example) that would be interesting to use : http://ez.no/doc/ez_publish/technical_manual/4_0/reference/template_functions/miscellaneous/cache_block

Looking for information about SQLI ?
Looking for a new job in Paris ?
Please contact me at alafon [at] sqli [dot] com

André R.

Friday 05 December 2008 1:55:37 am

Of course, but that will never be as fast as taking advantage of the view cache system.
We did some benchmarks recently and got something like:
~130 request/sec with view cache
~90 request/sec with view cache disabled and all but the line disabling the view cache inside a cache block
~32 request/sec with view disabled and no cache block in the node template

Pagelayout was tweaked so only a few lines where outside the two 'root' cache blocks (one for header and one for footer).
The numbers where using eZ Publish trunk (4.1, 4.0.1 was about ~8% behind) on a quad-core Xeon 2.5GHz.

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

John Smith

Friday 05 December 2008 8:50:41 am

Thanks Carlos Revillo, David Suela.

Enabled smart cache and uploaded the latest version of kernel/classes/datatypes/ezimage/ezimagealiashandler.php file from the SVN.

It is working fine.

Cheers,

eZ debug

Timing: Jan 30 2025 00:44:43
Script start
Timing: Jan 30 2025 00:44:43
Module start 'content'
Timing: Jan 30 2025 00:44:43
Module end 'content'
Timing: Jan 30 2025 00:44:43
Script end

Main resources:

Total runtime0.1236 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 587.7500180.8594
Module start 'content' 0.00470.0060 768.609497.9063
Module end 'content' 0.01070.1128 866.5156526.7109
Script end 0.1235  1,393.2266 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00312.5421200.0002
Check MTime0.00121.0037200.0001
Mysql Total
Database connection0.00050.426510.0005
Mysqli_queries0.082766.92851410.0006
Looping result0.00090.73981390.0000
Template Total0.112591.010.1125
Template load0.00070.602110.0007
Template processing0.111890.443010.1118
Override
Cache load0.00050.410310.0005
Sytem overhead
Fetch class attribute can translate value0.00080.657810.0008
XML
Image XML parsing0.00020.185410.0002
General
dbfile0.00655.2325200.0003
String conversion0.00000.004130.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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs