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,