Feature Request #37
Cache status methods
| Status: | New | Start: | 2008-03-05 | |
| Priority: | Low | Due date: | ||
| Assigned to: | Ryan Parman | % Done: | 0% |
|
| Category: | Cache | |||
| Target version: | 1.3 | |||
Description
We've gotten many requests over the years from people who want to know more about the status of their cache. I threw together an add-on for SP 1.0 that broke for 1.1. I'd like to propose adding a few methods for 1.2.
- $feed->get_cache() would return some sort of reference to the cache object.
- $feed->get_cache()->get_exists() would be a boolean response. True if cache exists for this feed (DB or FS).
- $feed->get_cache()->is_fresh() would be a boolean response. True if cache exists for this feed. Should we allow values for "Yes, it's fresh", "No, it's expired", and that in-between "It's expired but the most recent fetch failed so we're re-using the expired cache"?
- $feed->get_cache()->get_filename() would return either the FS filename or a DB identifer (or whatever the most useful data is for this).
- $feed->get_cache()->get_timestamp() would return the Unix timestamp for when the cache was created/refreshed (i.e. whenever the cache decides is the "start").
- $feed->get_cache()->get_time_remaining() would return the number of seconds until the cache expires.
I'm open to other ideas, as well as best ways to implement this or even if users would find it useful.
History
Updated by Ryan McCue 667 days ago
If it's not covered by other methods, I'd recommend a is_used() method.
Updated by Geoffrey Sneddon 429 days ago
- Target version changed from 1.2 to 1.3