[wp-hackers] Fetch Feed

Ryan Frankel ryan.frankel at gmail.com
Mon Oct 29 03:15:47 UTC 2012


1. Thanks for the info.
2. Good point.

Ryan

On Oct 28, 2012, at 11:06 PM, Ryan McCue wrote:

> 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/>
> 
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list