Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Wanted: LWP::Cacheby smalhotra (Scribe) |
on Aug 04, 2003 at 18:58 UTC ( [id://280761]=perlquestion: print w/replies, xml ) | Need Help?? |
smalhotra has asked for the wisdom of the Perl Monks concerning the following question:
I write a lot of apps that get data from the web. I lot of times I use WWW::Mechanize or just LWP::UserAgent directly. What I want is a cache like most other browsers (user agents) have. A lot of time the content requested is dynamic but most of the time when I am doing some sort of testing (parsing pages) I request the same page several times. I generally use one of two solutions:
(1) use Memoize on request() (2) write a wrapper that looks in a specified directory for the filename that I am requesting. Over time I add things like uptodate test (1 line) or a directory size check (2-3) lines. Is there a module out there that already does this, not generally, but specially for LWP? If not, then I am going to write LWP::Cache and would like some advice on what to add, and what to stay away from. $will->code for @food or $$;
Back to
Seekers of Perl Wisdom
|
|