Site links:
Distributed Computing

perlgcache - a Gnutella Web Cache

perlgcache is no longer being maintained. The load on caches was so high the last time I looked that a CGI script such as this is no longer practical. This page and the software will remain as a reference but I do NOT recommend running this. Use at your own risk.

perlgcache is a gnutella web cache written as a perl CGI script.

What is a gnutella web cache? - see the Gnutella Web Cache home page.


Download: perlgcache-0.8.3.tar.gz

Read the configuration section below before installing.


  • Requires no additional modules, so should work on any server allowing perl cgi scripts
  • Configurable options: anonymous request blocking, request rate limiting, statistics support, URL checking (direct or via proxy).
  • GWebCache v2 support.


0.8.3: Changes since 0.8.2

  • Changed URL validation to me much more strict on the syntax of URLs.

0.8.2: Changes since 0.7.9

  • Configuration moved out of main script and into a separate file.
  • Removed support for following 3xx redirects when checking URLs.
  • Added separate config option for lifetime of failed URLs. Failed URLs are not displayed by default.
  • Added support for matching against "I|net-not-supported" when testing v2 caches.
  • Added support for banning particular clients.
  • Moved style sheet out of the source to an external file.
  • Cleaned up HTML output to be valid XHTML/1.0.
  • Added support for correct stats for caches running on more than one physical host. Also, if a file "cacheinfo.txt" exists it is displayed at the top of each HTML page to allow identification of individual hosts.
  • Various other minor changes/cleanups.

0.7.9: Changes since 0.6.4

  • URL checking now defaults to ON.
  • V2 requests now default to ON.
  • Changed URL checking code from using IO::Socket::INET to low-level socket functions - may work on more hosts.
  • URL checking is now done in a forked process to prevent checks from delaying an update request. (Will this work on Windows?)
  • Speed-up in loading/saving of rate-limited IPs and stats.
  • Additional speed-up for rate-limited IPs by using separate lists per /8 network block.
  • New stats view - coloured graph drawn from HTML tables.
  • Various other minor fixes/changes.

0.6.4: Changes since 0.6.3

  • Fixed silly bug preventing URLs from being returned for GWC2 requests.

0.6.3: Changes since 0.5.3

  • Improved GWC2 support. Now keeps URLs separate for each network, addition of support=1 option.
  • Some tidying of the code and removal of warnings.
  • Removed the "prefer same client" hostfile logic. This was not really needed and it should be quicker without it.
  • Can be configured to run as a v1 only, v2 only or combined v1/v2 cache.
  • Other small tweaks and improvements.


Place the perlgcache.conf file in the same directory as perlgcache.cgi. To change a setting, remove the # from the start of the line and modify the value as needed.

$config{prefix}: default: data
You need to set $config{prefix} to point to a location where perlgcache can save it's data files. The default will attempt to save them in the same directory as the CGI script. If you are going to run it on your own server then "/tmp/gcache" may be suitable. If you are installing onto a shared server, something else may be better. See the hosts documentation for possible data-file locations.

Other options: see the comments in perlgcache.conf. The defaults should be suitable for most setups.


It's a very good idea to create a separate sub-domain for a web cache. eg. if you had, create a sub-domain of for the cache. This allows you to remove the sub-domain from the DNS if you want to remove the cache.

Don't have multiple URLs pointing to the same cache, either from multiple hostnames (eg. and or from multiple paths on the same server (eg. and

Announcing your cache

You can submit your cache to Your cache will be tested and if it's working OK it will be submitted to other caches within a few days. Note that this currently only supports version 1 caches.

Valid XHTML 1.0!Valid CSS!