Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8233783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:14:55+00:00 2026-06-07T18:14:55+00:00

I have a personal project to cache some rss feeds locally on my NAS

  • 0

I have a personal project to cache some rss feeds locally on my NAS drive (using it’s built-in web server and a chron job) so that I won’t miss “posts” when my desktop machine is switched off.

So far I have a simple php script set up that stores the cache for a single feed in a MySQL database. I will expand this to include multiple feeds and loop through them all, but for now I just want to make sure that what I want to do is possible. As SimplePie clears the cache when it expires, I was thinking of creating a copy of the “cache_data” and “items” tables to use like an archive – if I copy all new records into the new tables then it wouldn’t matter if SimplePie clear’s it’s own cache tables because I already have a copy of the items.

What I need to do now is create the output rss/xml file and I’m wondering if SimplePie can be used for this. I see two possibilities;

  1. Get SimplePie to use the “archive” tables as it’s cache location with expiring disabled so that nothing is removed.
  2. Read the data from the “arcive” tables myself and use SimplePie to process the data and build the rss feed.

I’ve had a look around the SimplePie documentation and through SimplePie.inc to see if I could find anything to point me in the right direction, but this is my first real php project and SimplePie contains rather a lot of complicated looking code. Any suggestions or pointers would be very appreciated 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T18:14:57+00:00Added an answer on June 7, 2026 at 6:14 pm

    Create your own SimplePie_Cache class, filling in the methods with code that gets and sets from your caching tables, or memcached, filesystem, or wherever. The only thing you need to know is to use $this->name as the name of the cache key for each of the functions.

    class MySimplePie_Cache extends SimplePie_Cache {
    /**
     * Create a new cache object
     *
     * @param string $location Location string (from SimplePie::$cache_location)
     * @param string $name Unique ID for the cache
     * @param string $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data
     */
      function __construct($location, $name, $extension) {
        $this->name = $name;
      }
    
      static function create($location, $filename, $extension) {
        return new MySimplePie_Cache($location, $filename, $extension);
      }
    
      function save($data) {
         // TODO: save $data to $this->name cache entry
         return true;
      }
    
      function load() {
         // TODO: load $data from $this->name cache entry
         return $data;
      }
    
      function mtime() {
        return time(); // this will disable any expiration checks
      }
    
      function touch() {
        return true; // not necessary, we don't need to update times, no expiration
      }
    
      function unlink() {
        return true;  // nothing will be removed from the cache
      }
    }
    

    Then, register the cache class to your feed:

    $feed = new SimplePie();
    $feed->set_cache_class("MySimplePie_Cache");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using git for a personal project at the moment and have run into
I have begun work on a personal project that may end up having some
For a personal project, I'm working on a small web-based game. I have a
I'm using Hibernate for a personal project. In my project, I have these directory:
I have this personal library management project. I have some Lists of derivate classes
I have a personal project I'm planning and I came to a small hurdle.
I have an old personal project written in Java 1.4 that I am porting
For a personal project I have been implementing my own libstdc++. Bit by bit,
I have a personal project that I'd like to build as an add-in for
I have smallish personal project consisting of the following Eclipse workspace. + +-MyApp //

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.