Tuesday, January 11, 2011

Clearing the Cache for Wordpress RSS feeds

I received an e-mail from one of the websites that I administrate. The request was for a news article/blog post to be displayed on the homepage. This particular news item was time-sensitive and the Wordpress caching system was delaying publication of the news item through the RSS feed.

After a bit 'o searching, I found the the offending code. Previously, in another blog, I had modified the like in rss.php, but that did not work.

This line was in a function called fetch_feed($url) in the file feed.php inside the wp-includes folder.

$feed->set_cache_duration(apply_filters('wp_feed_cache_transient_lifetime', 600, $url));

The original cache time was 43200, but I wanted 10 minutes, so I used 600. I saved and refreshed the page, with success.

No comments:

Post a Comment