On Sun, Feb 20, 2005 at 07:35:47PM -0600, Andy Lester wrote:
> >
> >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.
>
> Patches are certainly welcome. Anything you want to add to it, I'm
> glad to take a look at. I don't want WWW::Mechanize::Cached to mess
> with LWP::UserAgent::WithCache, though.
Andy,
OK, but then we have the problem that caching is implemented only
inside WWW::Mechanize::Cached and that it cannot be reused by people
who only want to use a caching version of LWP::UserAgent.
I would rather suggest not to invest into WWW::Mechanize::Cached and
prop up LWP::UserAgent::WithCache to use it as a proper replacement
for LWP::UserAgent:
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');
WWW::Mechanize would then use a 'component' user agent (instead of
being a subclass). Agreed, this is major design change, but one which
would give us more options.
For you to consider.
\rho
PS: Another option we have is to use HTTP::Cache::Transparent which
silently hooks itself into the request fetching. But that also
does not yet support proxy cache headers (yet).