Caching Framework - ask for validity
It woul be useful to ask the cache if it is still valid.
If something critical is cached - that for example depends on external (unreliable) interfaces.
This flow would be useful:
- check if cache is valid
- if not check if cached thing is available
- not available - do nothing just use the (expired cache) again
- available - flush cache and store new stuff...
Instead of (now):
- cache is expired
- cached object needs to be fetched
- if not available - nothing can be used.
Updated by Robert Lemke over 12 years ago
- Category set to Cache
- Status changed from New to Needs Feedback
- Assignee set to Robert Lemke
- Priority changed from Should have to -- undefined --
- Target version deleted (
I understand the use case for this, however this undermines the basic mechanisms of the caching framework which removes cache entries exactly when they become invalid (for example because a cache entry associated with a tag is removed).
How would we define when the invalid cache entry is enventually removed by the garbage collection?
In my opinion it's the application's task to determine if the cache entry is still valid. In these cases the cache entries should get an infinite expiry time from the perspective of the caching framework.