Forums / General / Cache Expiry - prevent global expiry every time you publish

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

eZ debug

Timing: Jan 31 2025 01:22:06
Script start
Timing: Jan 31 2025 01:22:06
Module start 'content'
Timing: Jan 31 2025 01:22:06
Module end 'content'
Timing: Jan 31 2025 01:22:06
Script end

Main resources:

Total runtime0.2078 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0076 588.1797370.2656
Module start 'content' 0.00770.0140 958.44531,001.5938
Module end 'content' 0.02160.1861 1,960.03913,893.0859
Script end 0.2077  5,853.1250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00482.3334200.0002
Check MTime0.00150.7021200.0001
Mysql Total
Database connection0.00110.535310.0011
Mysqli_queries0.110953.36691410.0008
Looping result0.00170.83951390.0000
Template Total0.185689.310.1856
Template load0.00090.415910.0009
Template processing0.184888.924710.1848
Override
Cache load0.00060.309510.0006
Sytem overhead
Fetch class attribute can translate value0.00200.939510.0020
XML
Image XML parsing0.00030.133810.0003
General
dbfile0.00331.5696200.0002
String conversion0.00000.003230.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