E
E
evilelf2015-07-09 13:04:47
Yii
evilelf, 2015-07-09 13:04:47

How to reset the cache in yii 1.1.16?

Good afternoon!
How to reset the cache in yii by the passed key?
Yii::app()->cache->delete($key) - doesn't
flush But Yii::app()->cache->flush() flushes. But all at once.
I want to make it possible to reset only a certain cache.
I use beginCache(). I pass there the key id, duration and depency with the CDbCacheDependency class.
In a config I use CFileCache
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
evilelf, 2015-07-13
@evilelf

Colleagues, in short, for COutputCache it worked.
And if there is a problem, then you can stupidly, on the page where the cache is used, display:

echo '<pre>';
print_r($this->beginWidget( 'COutputCache',array( 'id'=>$id, 'duration'=>$duration, 'dependency' => $dependency) ));
echo '</pre>';

And there to see the key

A
Alexander Makarov, 2015-07-10
@SamDark

Yii::app()->cache->delete(COutputCache::CACHE_KEY_PREFIX . $key);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question