#3950 closed enhancement (wontfix)
enhance fetch_rss to optionally have a variable cache timeout
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 2.2 |
| Component: | General | Keywords: | has-patch 2nd-opinion |
| Focuses: | Cc: |
Description
Issue: Plugin developers want to check a RSS feed only once per day.
Current Solution: Define MAGPIE_CACHE_AGE to the timeout value before retrieving RSS feed.
Issues with that solution: If multiple plugins want to use different timeouts, its impossible, Only the first item that uses fetch_rss may specify a timeout.
More Elegant solution: Allow fetch_rss() to accept a cache timeout: fetch_rss($rssFeedUrl,24*60*60)
Other Notes:
Patch attached to make this possible, At present All RSS feeds are cached for 1hour, unless MAGPIE_CACHE_AGE is set beforehand.
This also allows developers to disable the RSS cache by specifying a timeout value of 0 seconds. This is not aimed at plugin developers, but mainly towards developers working on any Administration issues which may require constant RSS updates.
Attachments (2)
Change History (9)
#1
@
19 years ago
- Keywords 2nd-opinion added
Alternate patch added which adds the function
fetch_rss_timeout ($url, $timeout = false )
Designed in mind to allow easier backwards compatibility, Also to allow plugin authors to check if the WordPress install supports the timeout option or not ( if (function_exists('fetch_rss_timeout'))..
#5
@
18 years ago
I'm tempted to close as wontfix, It doesnt appear to have much traction from others, and storing an option instead works just as well.
Alternativly, You can manually create a RSSCache object and set custom timeouts that way, fetch_rss should pick up those custom RSSCache objects AFAIK. (I believe, i've not attempted this, but plan to for a plugin)
fetch_rss add $timeout