Net::Squid::Purge - Send purge requests to squid easily
Allows you to send multiple purge requests to one or more squid servers easily.
use Net::Squid::Purge; my @squid_servers = ( { host => '192.168.100.3' }, { host => '192.168.100.4', port => '8080' }, ); my $purger = Net::Squid::Purge->new; $purger->squid_servers(\@squid_servers); $purger->purge('http://localhost/', 'http://localhost/home/');
As taken directly from the squid docs:
A purge feature was added to Squid-1.1.6. It only allowed you to purge HTTP objects until Squid-1.1.11. Squid does not allow you to purge objects unless it is configured with access controls in squid.conf. First you must add something like
acl PURGE method purge acl localhost src 127.0.0.1 http_access allow purge localhost http_access deny purge
The above only allows purge requests which come from the local host and denies all other purge requests.
To purge an object, you can use the client program:
squidclient -m PURGE http://www.miscreant.com/
If the purge was successful, you will see a '200 OK' response:
HTTP/1.0 200 OK Date: Thu, 17 Jul 1997 16:03:32 GMT Server: Squid/1.1.14
If the object was not found in the cache, you will see a '404 Not Found' response:
HTTP/1.0 404 Not Found Date: Thu, 17 Jul 1997 16:03:22 GMT Server: Squid/1.1.14
Attempt to purge a set of urls from the squid cache.
This returns the PURGE request that is sent.
Creates the object.
Nick Gerakines, <nick at socklabs.com>
<nick at socklabs.com>
Paul Lindner, <lindner at inuus.com>
<lindner at inuus.com>
Please report any bugs or feature requests to bug-net-squid-purge at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-Squid-Purge. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-net-squid-purge at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Net::Squid::Purge
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Net-Squid-Purge
CPAN Ratings
http://cpanratings.perl.org/d/Net-Squid-Purge
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Squid-Purge
Search CPAN
http://search.cpan.org/dist/Net-Squid-Purge
Squid cache purging documentation
http://meta.wikimedia.org/wiki/Squid_caching
Copyright 2006 Nick Gerakines, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Net::Squid::Purge, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Squid::Purge
CPAN shell
perl -MCPAN -e shell install Net::Squid::Purge
For more information on module installation, please visit the detailed CPAN module installation guide.