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