ZF-3508: API to get metadate for a given id


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)

just commited into SVN trunk new methods "touch($id, $extendedLifetime) or getMetadatas($id)" (for File and Apc backend only, for the moment)

can you try it ?


fixed in SVN trunk

Changing issues in preparation for the 1.7.0 release.