SimplePie 1.3.1 is now available. Upgrade now!

SimplePie Documentation.  Learn how to use this thing.  It's way better than going to school.

You are here: Documentation » Frequently Asked Questions » How do I do database caching?

How do I do database caching?

Official Support

As of version 1.1, SimplePie only officially supports file system caching. However, we have integrated support for MySQL caching into the trunk which is available via Subversion, and will be included as a standard part of the 1.2 release.

If you simply want to cache to a database, the aforementioned development build is the way to go. By helping us work out the remaining bugs, we can get official database support integrated sooner. The important part to know is that the database location is set just like a normal URL:

$feed->set_cache_location('mysql://username:password@hostname:port/database');

Hacking Custom Support

If you're going to hack in your own database support, I would wholeheartedly recommend extending and overloading the SimplePie_Cache class to do it. SimplePie calls on methods in SimplePie_Cache for saving, loading, and checking the freshness of cached data. By overloading this class, you can have SimplePie do all of the things it needs to do while using your custom class.

Check out the following links for tips on extending and overloading the SimplePie_Cache class:


faq/how_do_i_do_database_caching.txt · Last modified: 2011/03/05 19:56 (external edit)