Hi all,
I hope I did not miss an obvious solution to the following:
I want a *caching* version of WWW::Mechanize.
- No, WWW::Mechanize::Cached does not cut it for me. It does not
honor any HTTP cache control headers. And, also, I think that
caching better belongs to the UserAgent. Here it is much more
reusable anyway.
- There is a LWP::UserAgent::WithCache, but that is also agnostic
about HTTP. Even if that is fixed, I see it difficult to use it
together with WWW::Mechanize, as both are proper subclasses
of LWP::UserAgent.
I could do a
use WWW::Mechanize;
@WWW::Mechanize::ISA = ('LWP::UserAgent::WithCache');
my $mech = WWW::Mechanize->new();
but this looks like an awful hack to me.
Is it possible to do something like this:
use LWP::UserAgent::WithCache;
my $ua = new LWP::UserAgent::WithCache (...specify caching...);
use WWW::Mechanize;
my $mech = new WWW::Mechanize (ua => $ua,
agent => 'I gather');
?
\rho