Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Simple urllib2 caching handler

Project Description

This is a simple caching handler for urllib2.


Either use the build_opener function which takes the path to the cache folder and returns an OpenerDirector instance. You can then use it’s open method to open urls normally. If the file was already downloaded, then it will be taken from the cache.

You can also use the CachedHandler wherever it’s useful within urllib2. This also takes the path to cache folder as an argument of the constructor.

Be aware that the caching is very simple. It detects incomplete downloads but doesn’t take any caching headers into account. To invalidate the cache you have to delete the files in the cache folder.


1.0.1 - 2008-07-23

  • Fixed packaging. [fschulze]

1.0 - 2008-07-22

  • Initial release. [fschulze]

Release History

This version
History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(2.3 kB) Copy SHA256 Hash SHA256
Source None Jul 23, 2008

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers