Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.5.2
-
Fix Version/s: 1.7.0
-
Component/s: Zend_Cache
-
Labels:None
Description
It would be nice to have an API to read the meta data of a given cache entry (when was the item cached, what tags does the item have or maybe custom metadata).
Here is an example scenario:
An application that displays financial data should be updated every minute. However if updated financial data is not available, the existing data should still be used for up to 4 hours along with a timestamp in red to display the time when the data was last updated.
For implement this, the cache TTL would be set to 4 hours. In the code the metadata would first be read to determine if the data is older than 1 minute. If so a request is made and the cache is updated if new data is available. Otherwise the current data will be read.
Ideally there would even be a way to write some more custom metadata like "lastchecked" so that the check if the data is older than 1 minute is only done every 30 seconds at most.
the test() method is a good solution for mtime
for other things, it requires big changes (but i agree with you)