View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Nicholas Gerakines > Net-Squid-Purge-0.1 > Net::Squid::Purge



Annotate this POD


New  1
Open  0
View/Report Bugs
Module Version: 0.1   Source  


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 => '' },
    { host => '', port => '8080' },
  my $purger = Net::Squid::Purge->new;
  $purger->purge('http://localhost/', 'http://localhost/home/');

How can I purge an object from my cache? ^

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
  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

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>

Paul Lindner, <lindner at>


Please report any bugs or feature requests to bug-net-squid-purge at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.

    perldoc Net::Squid::Purge

You can also look for information at:


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.

syntax highlighting: