Subject: | Patch: function to clear current page from cache |
Date: | Sat, 09 Dec 2006 23:04:31 -0800 |
To: | Andy Lester <andy [...] petdance.com> |
From: | c [...] says.mu |
damn, sorry to hear that.
here's what i just made, seems to work. don't trust me, i'm an idiot.
clear_cache()
Clears cache for current page. Returns is_cached() status as a
convenience (false on success).
sub clear_cache
{
my $self = shift;
return unless $self->{_is_cached};
my $request = $self->url();
my $req = $request->as_string;
my $cache = $self->{$cache_key};
my $response= $cache->clear( $req );
$self->{_is_cached} = $cache->get($req)?1:0;
return $self->{_is_cached};
}
coby
Andy Lester wrote:
Show quoted text
> On Dec 10, 2006, at 12:46 AM, c@says.mu wrote:
>> hah, you read my email much faster than i have figured anything
>> out :)
>>
>> i'm too terrible to write anything for public consumption.. i
>> would though! i dont use perl very often anymore, but i do use
>> this module for personal stuff from time to time. i remember being
>> confused about this issue in the past.
> Just write up what you did, and why you did it. Give me the tech
> stuff (since I don't even know how you'd do what you're talking
> about) and I'll add it to the docs.
> WWW::Mechanize::Cached isn't something I wrote. I took over for it
> when the original owner died a few years ago. So any help you can
> give would be swell.
> Thanks,
> xoxo,
> Andy
> --
> Andy Lester => andy@petdance.com => www.petdance.com => AIM:petdance