If you have ever used fetch_feed to bring RSS into your WordPress site, you may have been concerned about the amount of time it takes to update its cache. Fortunately, the solution is simple.
Just add the following code into your themes functions.php file, between the main php tags:
add_filter('wp_feed_cache_transient_lifetime', create_function('$a', 'return 300;'));
Where it says return 300, I am simply telling fetch_feed to refresh it’s cache after 5 minutes (300 seconds).
And that’s it! Quite a useful little filter hook – just thought I’d share it.
10:34 28/01/2011
That was a nice and short writeup on cache duration, keep them coming!!..
12:09 28/01/2011
I enjoyed to c that thinks. Great informative and helpful article.
02:27 27/07/2011
This was very helpful. Thank you.
Ben