If you want to decrease RSS cache time in WordPress plugin? It is better practice to change cache time for specific feed URL rather than globally:
The default lifetime of a transient cached feed is 12 hours. It can be changed by hooking in to the wp_feed_cache_transient_lifetime filter.
This will change the feed cache to update every 10 minutes:
1 2 3 4 5 6 7 8 9 | add_filter( 'wp_feed_cache_transient_lifetime', 'speed_up_feed', 10, 2 ); function speed_up_feed( $interval, $url ) { if( 'http://mysite.org/feed' == $url ) return 600; return $interval; } |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.