[wp-hackers] Fetch Feed

Ryan McCue lists at rotorised.com
Mon Oct 29 03:06:11 UTC 2012


Ryan Frankel wrote:
> 1. If I use fetch_feed() multiple times on a page does it cache the results
> separately?  I assume it does.

It caches it based (mainly) on the URL, so if the URL of the feed is 
different, then they will be cached separately; if they're the same feed 
loaded twice, it should load it from the cache. If possible, avoid doing 
this, because it means that SimplePie has to be run twice to parse the 
data (the data is cached at a low-level, only a step or two higher than 
the raw XML).
> 2. Since fetch_feed caches the results is there any way to tell if an
> 'item' is new? For example, something like...
>
There's a tutorial on how to do this natively with SimplePie: 
http://simplepie.org/wiki/tutorial/how_to_display_previous_feed_items_like_google_reader

Your best bet is to adjust that tutorial and adapt it to WordPress using 
options instead.

-- 
Ryan McCue
<http://ryanmccue.info/>



More information about the wp-hackers mailing list