i need to manually unset/invalidate a fragment cache (i use $this->beginCache('left-menu', array('duration'=>86400)) to create the cache) with a specific id in some actions so i use:
I mean beginCache('left-menu') does not use 'left-menu' as the underlying cache key. It combines other information to implement cache variation.
ok so how what is the right use? The manual says that we can set the key as a string and that we can delete/invalidate the cache passing that key string to the delete method....so how can i invalidate my cache?
You would have to have a way generate the key that Yii is generating when it sets the cache key.
I know for setting the item it's a combination of a prefix which is usually blank and then using md5 to generate the key that is stored. I discovered this when i was trying to view a item i cached as a test using telnet to connect to the daemon.
You would have to have a way generate the key that Yii is generating when it sets the cache key.
I know for setting the item it's a combination of a prefix which is usually blank and then using md5 to generate the key that is stored. I discovered this when i was trying to view a item i cached as a test using telnet to connect to the daemon.
sorry i still don't understand. What is the purpose of the delete method if i cannot use it?
I mean beginCache('left-menu') does not use 'left-menu' as the underlying cache key. It combines other information to implement cache variation.
so can you explain us how to clear/invalidate a cache setted with CController::beginCache() method knowing that i passed to that method a string as a cache key?
This is currently not possible. The reason is that: given your id, the actual key to the cache is calculated as func(id, other factors). The factors include GET parameters, session parameters, etc. As you can, a single ID may correspond to multiple cache entries.
We may considering adding a support to delete cache items based on partial match of cache keys. Could you please create a ticket for this? Thanks.
This is currently not possible. The reason is that: given your id, the actual key to the cache is calculated as func(id, other factors). The factors include GET parameters, session parameters, etc. As you can, a single ID may correspond to multiple cache entries.
We may considering adding a support to delete cache items based on partial match of cache keys. Could you please create a ticket for this? Thanks.
mmm…so right now how can i delete a particular cache created with beginCache? Only setting a expire time or dependency check?
The delete operation is used to delete a data item that you store directly via Yii::app()->cache->set() or add(). COutputCache is different because there may not be a one-to-one mapping between ID and the underlying cache key.
The delete operation is used to delete a data item that you store directly via Yii::app()->cache->set() or add(). COutputCache is different because there may not be a one-to-one mapping between ID and the underlying cache key.
ok understand. So how i invalidate/delete a fragment cache? Only with expire time or dependecy check?