Zend Framework

API to get metadate for a given id

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Major 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.

Activity

Hide
Fabien MARTY added a comment -

the test() method is a good solution for mtime

for other things, it requires big changes (but i agree with you)

Show
Fabien MARTY added a comment - the test() method is a good solution for mtime for other things, it requires big changes (but i agree with you)
Hide
Fabien MARTY added a comment -

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 ?

thanks

Show
Fabien MARTY added a comment - 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 ? thanks
Hide
Fabien MARTY added a comment -

fixed in SVN trunk

Show
Fabien MARTY added a comment - fixed in SVN trunk
Hide
Wil Sinclair added a comment -

Changing issues in preparation for the 1.7.0 release.

Show
Wil Sinclair added a comment - Changing issues in preparation for the 1.7.0 release.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: