Share » Forums » Developer » cache_ttl - am I going mad!

cache_ttl - am I going mad!

cache_ttl - am I going mad!

Friday 20 August 2004 10:42:53 am - 6 replies

Modified on Friday 20 August 2004 10:44:33 am by David Syers

Author Message

Björn Dieding@xrow.de

Sunday 22 August 2004 5:21:24 am

As far as I can remember

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

has no effect on content/view templates when view chaching is on.

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

David Syers

Sunday 22 August 2004 8:22:09 am

Trust me it does (providing the view has not already been cached). With viewing caching on and setting cache_ttl to 0 disables the cache, but anything else has no effect and the normal caching takes over.

Looking at kernel/classes/eznodeviewfunctions.php at lines 125-140 you have:

// Check if time to live is set in template
        if ( $tpl->hasVariable( 'cache_ttl' ) )
        {
            $cacheTTL =& $tpl->variable( 'cache_ttl' );
        }

        if ( !isset( $cacheTTL ) )
        {
            $cacheTTL = -1;
        }

        // Check if cache time = 0 (disabled)
        if ( $cacheTTL == 0 )
        {
            $viewCacheEnabled = false;
        }

This is what is turning the cache off if it set to 0, but does nothing else with the cache if it is set to anything else. Is this correct? eZ crew - should the cacheTTL be used if set?

Paul Borgermans

Sunday 22 August 2004 8:30:56 am

Björn,

In theory (and to my experience) it is meant to be used when view-caching is on.

The behaviour with non-zero values seems to be a bug

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Björn Dieding@xrow.de

Monday 23 August 2004 3:00:55 am

Hi you two,

I was wrong.

I also can confirm this "bug", I checked the code and I wasn't able to find a place where the cache_ttl from a template is used to expire cache.

eZNodeviewfunctions::generateNodeView seems to be the only function that reads that value from the template.

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

Björn Dieding@xrow.de

Monday 23 August 2004 3:17:14 am

http://ez.no/community/bug_reports/there_seems_to_be_a_bug_with_the_cache_ttl_template_var

I just created a bug report about this.

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

Wenyue Yu

Wednesday 08 September 2004 7:00:29 am

Hi,

The bug is fixed in svn 7924.

Regards,
wenyue

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu