Set expiration to CacheItem already in CacheManager

Topics: Caching Application Block
Jun 29, 2007 at 5:59 AM
Is it possible to flag or set an expiration to a CacheItem already in the CacheManager based on business logic? I noticed that the CacheItem properties and methods are internal so is there an alternative?

Thanks.
Jun 29, 2007 at 8:15 PM
Hi,

You can define your own expiration class by implementing the ICacheItemExpiration interface with your business logic, and provide instances of your expiration class when you add objects to the cache by using the full override of CacheManager.Add(). You need to be careful to make this expiration check efficient, though.

Regards,
Fernando


tk wrote:
Is it possible to flag or set an expiration to a CacheItem already in the CacheManager based on business logic? I noticed that the CacheItem properties and methods are internal so is there an alternative?

Thanks.