Feedcache with memcache
I use a lot of open source tools and code in my work. In the past, I have provided a few patches and/or bug reports to some projects. I’m not sure that I’ve ever actually built new features for existing projects. It’s sad but true.
That all changes today with this commit of my working code that adds memcache caching to Doug Hellman’s handy feedcache. Feedcache is a module that adds a persistent cache to the feedparser module. If you are parsing RSS feeds, it’s nice to your users and the feed publishers to cache the feed contents on your side.
Doug’s original work was built around modules like shove and/or shelve and it works great in that way. I wanted to have my cache stored in memcache instead. So, I forked the project into feedcache-memcache.
It’s a very simple addition, all things considered. The only trick is that most of Doug’s code expects to use a dictionary-like interface to the cache. Shelve and shove provide these, but memcache, while it does use set() and get() methods, doesn’t provide a true dictionary interface. As a side project, it would be cool to add true dictionary-like methods to the python-memcache module.
With the move to memcache from something like shelve, you will lose true persistence (at least with vanilla memcache). So, keep that in mind if you need true persistence.
The tests are coming. I’m not much of a testing guy, but I know that code in the public realm like this needs it.
Let me know what you think. I’m very happy to have finally done something that I feel I can give back to a community that has done much for me.
Feedcache-memcache is available on bitbucket. I’m predominantly a git user, so if there’s something hg-specific I can do to make the repo easier to use, please let me know.
My thanks to Doug not just for his code, but for some direction he provided as I worked through his code.
Filed under: Programming, Python | Leave a Comment
Tags: feedcache, memcache, open source, Python, rss
No Responses Yet to “Feedcache with memcache”