Randal L. Schwartz wrote:
"Mattias" == Mattias Holmlund <[EMAIL PROTECTED]> writes:Mattias> use strict;
Mattias> use LWP::UserAgent;
Mattias> BEGIN Mattias> { Mattias> print "Installing\n"; Mattias> $LWP::Simple::FULL_LWP++;
Mattias> my $org_simple_request = \&LWP::UserAgent::simple_request;
You need "require LWP::UserAgent" first, to ensure that this routine has its original definition.
I have a use LWP::UserAgent a few lines up. Is that not sufficient?
The most important part here is to be conservative. Cache only that which is cachable, and pass everything else directly to the original routine. Be as thin as you can.
Yes I agree. I will start off very conservatively and only cache GET. I will also skip anything with a Range-header. I don't think I will support content-callbacks in the first version either.
The cache will (at least initially) always ask the server if the data is up-to-date, so I won't have to do any expiration calculations.
/Mattias
