CachingCallHandler Sliding Expiration vs. Absolute Expiration

Topics: Policy Injection Application Block
Jan 22, 2009 at 3:59 PM
It appears that the CachingCallHandler using Sliding Expiration rather than Absolute expiration.  Is there a way to configure it to use absolute expiration?  Here's my problem, I want to cache the results of a method that is frequently called in my application for 10 minutes, but since the CachingCallHandler appears to reset the expiration time each time the method is called regardless of whether the method was intercepted or not, my application will in all practical purposes never get a refresh of the cache.
Jan 23, 2009 at 3:13 AM
You would have to modify the entlib source code, specifically the AddToCache method of the CachingCallHandler.  It uses the Cache.NoAbsoluteExpiration as parameter to the Insert method of the Cache object.  Replace this to Cache.NoSlidingExpiration.

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.