Cache Expiry - prevent global expiry every time you publish

Author Message

Valentin Svelland

Monday 08 December 2003 12:26:52 am

I know a lot of us who loves the possibilites of eZ Publish still struggle with performance. I've been ready to put my site into production for some time now, but the load time takes to long due to global expiry of cache every time I publish something new, and also due to the fact that my webhost provider doesn't support either php acceleration or httrack for static mirroring. I'm still working on them to see the light so that I can test out tools like eZ Sitecopier of Denis Braekhus:
http://www.ez.no/developer/ez_publish_3/contributions/ez_sitecopier

Of course I've been experimenting with expiry-variable of cache-block :

"Expiry
If you don't specify the expiry parameter eZ publish will automatically expire the cache block in two hours or if any content is published. This means that if you publish anything on your site all cache-blocks will be expired.

If this expiry does not fit your needs you can specify the expiry time manually in seconds.

Example (expire after 120s):
{cache-block expiry=120}
... tpl code
{/cache-block}

NOTE: it's not possible to say that a cache-block should not expire even if any content is published (yet). "

..and I've also looked into using the {set-block scope=root variable=cache_ttl}7200{/set-block} -line on top of my tpls such as folder.tpl and article.tpl.. Didn't do the trick still...

TIP!
Now I've heard this little trick (haven't tried it out yet, will do shortly):

Comment out the line (142) in
lib/eztemplate/classes/eztemplatecachefunction.php:
$expiryTime = max( $localExpiryTime, $globalExpiryTime );

..and the cache blocks will not be emptied when publishing content. Instead the expiry parameter can be used to define the life span of the cache files. I'm trying out this approach now.

Of course, I'd love to hear others experiences when it comes to speeding up eZ Publish without the possibility of static mirroring. :)

By the way, I'm currently running ver 3.2-2 of eZ Publish on Linux/MySql.

Bård Farstad

Tuesday 20 January 2004 7:30:48 am

Just a note, the cache block function has a ignore_content_expiry option which does not expire template block cache when any content is published.

Updated doc at:
http://ez.no/developer/ez_publish_3/documentation/incoming/cache_block_optimization

--bård

Documentation: http://ez.no/doc

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 19:37:35
Script start
Timing: Jan 18 2025 19:37:35
Module start 'layout'
Timing: Jan 18 2025 19:37:35
Module start 'content'
Timing: Jan 18 2025 19:37:36
Module end 'content'
Timing: Jan 18 2025 19:37:36
Script end

Main resources:

Total runtime1.2748 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 588.1641152.6563
Module start 'layout' 0.00650.0035 740.820339.5078
Module start 'content' 0.01001.2633 780.3281539.5078
Module end 'content' 1.27330.0014 1,319.835912.0938
Script end 1.2747  1,331.9297 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2610160.0002
Check MTime0.00120.0952160.0001
Mysql Total
Database connection0.00090.071710.0009
Mysqli_queries1.223896.0020540.0227
Looping result0.00060.0433520.0000
Template Total1.242797.520.6213
Template load0.00180.141420.0009
Template processing1.240897.339420.6204
Template load and register function0.00010.008010.0001
states
state_id_array0.00110.083610.0011
state_identifier_array0.00090.067120.0004
Override
Cache load0.00160.1227300.0001
Sytem overhead
Fetch class attribute can translate value0.00070.058620.0004
Fetch class attribute name0.00100.081040.0003
XML
Image XML parsing0.00090.073720.0005
class_abstraction
Instantiating content class attribute0.00000.000540.0000
General
dbfile0.00100.0760230.0000
String conversion0.00000.000840.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
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 19
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs