I’m trying to add a custom feed format to my site (basically exporting data to an Excel file) and I’m getting confused by the feed caching settings. I can’t figure out how to flush the cached feeds, or to turn off feed caching altogether while I’m in development.
I’ve tried deleting all the _transient_feed...
, _transient_timeout_feed...
and _transient_rss...
options, but I’m still seeing the cached feeds.
And, based on some advice in this support forum thread, I tried on a whim adding this line to my wp-config.php:
define('MAGPIE_CACHE_AGE', 0);
(Obviously I’d like some caching of feeds, but it would help in development to be able to turn off the feed caching.)
Anybody got any suggestions?
Some clarification:
Sorry, I think I wasn’t clear enough in the initial question, and then I threw you all by referring to the magpie cache, which was completely on the wrong path. I was shooting blind at first.
I’m adding a feed to my site using add_feed()
. The function that generates the feed is using the PHPExcel class to write an excel spreadsheet. Then I’m setting appropriate headers for download, and outputting the .xls file data.
I think my problem might actually be a browser caching issue. The urls that I’m trying to output my feeds from look this this: mysite.com/facility/ummc/?feed=master_log and the xls file that’s generated is called Master_Log.xls.
Adding a cache busting string to the url request can get around the cache, i.e. requesting a feed from mysite.com/facility/ummc/?feed=master_log&now=12ag4oSduq344 … I was just wondering if there was any way of disabling the cache altogether.
It definitely might be a caching issue. I find REDbot is excellent for quick check of how result is served and what are its caching settings.
If you ever need to just update a single feed RIGHT NOW, for example, to reflect changes made in site settings or a plugin, all you have to do is update any of the posts that appear in the feed.
The reason for this is that WordPress, I conjecture, when serving up a feed, checks all the posts in the feed, and if none of them have been updated since the feed was cached, it serves the cache, but if a post has been updated, it regenerates the feed and refreshes the cache.
This has been useful to me a number of times, for example, when I needed to update a feed for submission to iTunes.
try
I have been all day find solution to deal with the feed cache as it is not easy to be cleared while I need it as a developer. Finally I got solution by implementing a script that I found here.
I put the script in wordpress root folder so each time I make an update to the source feed I just only do clearing the rss cache by run the script like this:
This script will eliminate the current cached feed so later it will force wordpress to get the new updated feed to show up.