UK based. Perl, XML/HTTP, SAP, Debian hacker.
Yesterday I was playing with xmltv feeds. I knocked up a little app that connects to a remote server, grabs a file (in this case xml), stores it in a cache, passes it into a templating engine (XSLT), and spits the result out as a web page.
The code is based on an RSS display tool I previously wrote. It's the same principle, grab something, transform it, and display it. In both cases I don't want to grab the data every time, I'm happy to use a local copy if it's only a few hours old.
I realised that a lot of the code could be abstracted out into a module. The transformation element may be to specialised, but we shall see.
I'm not trying to re-invent Squid, I just want a simple URI getting tool, that can cache data. Basically you can call the app many times, but not check source data every time.
Does this exist on CPAN already? is so where? If it doesn't exist already, what should I call it?
LWP (Score:2)
Re:LWP (Score:2)
Interesting idea. I knew LWP did some caching, but I thought it was in memory caching, for within a single process, not file caching. This is probably enough, certainly for me anyway.
However LWP still has to do a HTTP request, to determine if the page has changed, and some feed providers may still dislike the frequency of the requests, even if they are only "304, Not modified since last retrieval".
My other option is to use cron and Wget to obtain the data, and try not do my data gathering at page viewin
-- "It's not magic, it's work..."
Re:LWP (Score:2)
Honestly, anyone getting antsy about an individual user refreshing their RSS feed a few times in a few minutes has way too much time on their hands, and doesn't understand the web.
Re:LWP (Score:2)
-Dom
Re:LWP (Score:2)
Good idea, I hadn't thought of that.
-- "It's not magic, it's work..."