WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How can I flush the RSS cache? (9 posts)

  1. WPChina
    Member
    Posted 6 years ago #

    I am posting the headlines of other blogs on my WP blog via RSS. For the last week, 4 of the feeds are updating fine, but two seem stuck -- even though the source feeds have information from today, my WP blog still has information cached from 10 days ago.

    Is there a way to "flush" the RSS cache on my blog? I have access to PHPMyAdmin, so is there a way to run a query, and if so what should I do?

    This is the code I'm using to grab RSS feeds:

    <?php
    require_once(ABSPATH . WPINC . '/rss-functions.php');
    $rss = fetch_rss('http://LINKTOFEED');
    echo '<!--Start-->';
    for($i=0;$i<4;$i++) {
    $item=$rss->items[$i];
    echo '<p><a href="'.$item['link'].'">'.$item
    ['title'].'</a></p>';
    }
    echo '<!--RSS FEED STOPS HERE-->';
    ?>
  2. WPChina
    Member
    Posted 6 years ago #

    Sorry to bump after 2 days, but this is rather urgent and I can't find RSS flushing info elsewhere -- I'm sure others have had similar problems, right?

  3. timfitz
    Member
    Posted 6 years ago #

    I am having the same problem.

  4. WPChina
    Member
    Posted 6 years ago #

    Yes, does anyone have any advice for timfitz and me?

  5. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    In the wordpress options table, look for rows that have a key of rss_big-bunch-of-gibberish-here. Those are the cache entries. Delete those rows.

    Note, only delete the rows with the gibberish looking keys. Don't delete rss_anything_else.

  6. WPChina
    Member
    Posted 6 years ago #

    Tks!!!

  7. shacker
    Member
    Posted 6 years ago #

    So is there no setting that can be passed in for affecting the cache lifetime/length? I'd like to do something like 30 minutes, but it seems to be caching for more than 12 hours (and obviously I don't want to be digging around in mysql tables all the time).

    Thanks.

  8. whooami
    Member
    Posted 6 years ago #

    you can set the time to cache feeds, its just Magpie.

    wp-includes/rss.php

    if ( !defined('MAGPIE_CACHE_AGE') ) {
    		define('MAGPIE_CACHE_AGE', 60*60); // one hour
    	}

    change as you like.

  9. shacker
    Member
    Posted 6 years ago #

    Ah, turns out it wasn't fetch_rss causing this, but Twitter changed their atom feeds to run through a password protected bloglines account. But vanilla RSS still works. Thanks anyway whoo good to know.

Topic Closed

This topic has been closed to new replies.

About this Topic