Caching RSS feeds or any other data
It’s no secret that web surfers like their content fresh and fast. A lot of the time, the process of downloading, parsing, formatting and displaying XML data such as RSS feeds, can create a significant time lag on the end user’s web browser. Especially if the server you are pulling the information from is slow.
I was asked by a client to implement an RSS feed of their company’s blog posts onto their website’s home page. They also wanted caching functionality that would only pull the blog feed every 12 hours.
I am new to PHP and ASP, but know just enough to get by (or get me into trouble). Not exactly knowing where to start, I did a search online for some open source solutions. I ran across an article on OpenHosting.co.uk that offered some prebuilt ASP functions to check if a cached file is expired, to write to the cached file, and to fetch the cached file. With a little bit of fudging, I made it work for my own purposes, adding it to my RSS fetching code.
Pretty neat, very simple.
No Comments