Yii Framework Forum: Default Duration In Coutputcache - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Default Duration In Coutputcache Rate Topic: -----

#1 User is offline   msoa 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 253
  • Joined: 15-August 12

Posted 09 January 2014 - 03:47 PM

COutputCache::duration property:

Quote

public integer $duration;
number of seconds that the data can remain in cache. Defaults to 60 seconds. If it is 0, existing cached content would be removed from the cache. If it is a negative value, the cache will be disabled (any existing cached content will remain in the cache.)
Note, if cache dependency changes or cache space is limited, the data may be purged out of cache earlier.


In this code if we don't define the duration property the content as default regenerate each 60 seconds?
	beginCache('categoriesMenu',array('dependency'=>array(
		'class'=>'system.caching.dependencies.CDbCacheDependency',
		'sql'=>'SELECT unix_timestamp(MAX(update_date))+count(*) FROM category',
	)))): ?>

I think due we have an dependency, until this dependency is valid duration is not matter. Do i think right?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users