PDA

View Full Version : Programmatically disable caching



sideout
11-10-2008, 12:57 PM
Suppose I have some CacheResult attributes set on members of a class and I want to disable caching at runtime sometimes. Is this possible? I'd like to have a flag to turn caching on/off in a particular case in case it has unexpected consequences in production. Right now my fallback plan is to use a separate cache object for just this feature and set it to scope="request" to sort of turn caching off but this is not ideal.

sideout
11-10-2008, 03:48 PM
The ability to turn it off programmatically would also help for more easily creating unit tests that check functionality with caching on/off.