Andy Lester > WWW-Mechanize-Cached-1.32 > WWW::Mechanize::Cached



Annotate this POD (1)


New  2
Open  0
View/Report Bugs
Module Version: 1.32   Source  

Name ^

WWW::Mechanize::Cached - Cache response to be polite

Version ^

Version 1.32

    $Header: /home/cvs/www-mechanize-cached/,v 1.18 2004/04/12 03:21:25 andy Exp $

Synopsis ^

    use WWW::Mechanize::Cached;

    my $cacher = WWW::Mechanize::Cached->new;
    $cacher->get( $url );

Description ^

Uses the Cache::Cache hierarchy to implement a caching Mech. This lets one perform repeated requests without hammering a server impolitely.

Constructor ^


Behaves like, and calls, WWW::Mechanize's new method. Any parms passed in get passed to WWW::Mechanize's constructor.

You can pass in a cache => $cache_object if you want. The $cache_object must have get() and set() methods like the Cache::Cache family.

The cache parm used to be a set of parms that described how the cache object was to be initialized, but I think it makes more sense to have the user initialize the cache however she wants, and then pass it in.

Methods ^

Most methods are provided by WWW::Mechanize. See that module's documentation for details.


Returns true if the current page is from the cache, or false if not. If it returns undef, then you don't have any current request.

Thanks ^

Iain Truskett for writing this in the first place.

Oddities ^

It may sometimes seem as if it's not caching something. And this may well be true. It uses the HTTP request, in string form, as the key to the cache entries, so any minor changes will result in a different key. This is most noticable when following links as WWW::Mechanize adds a Referer header.

Bugs, Requests, Comments ^

Support for this module is provided via the CPAN RT system:

This makes it much easier for me to track things and thus means your problem is less likely to be neglected.

Licence and copyright ^

This module is copyright Iain Truskett and Andy Lester, 2004. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.000 or, at your option, any later version of Perl 5 you may have available.

The full text of the licences can be found in the Artistic and COPYING files included with this module, or in perlartistic and perlgpl as supplied with Perl 5.8.1 and later.

Author ^

Iain Truskett <>, currently maintained by Andy Lester <>

See also ^

perl, WWW::Mechanize.

syntax highlighting: