GCache is a Python module that provides a generic cache class useful for speeding up any application where objects are referenced by keys. It uses object metadata to optimize hit-rates and freshness for fetches, and uses a "write-through" mechanism for writes and deletes. It can use "if-modified-since" fetches or rsync delta updates to refresh stale cached objects. GSource classes are provided for generating useful metadata from common sources (os.stat calls and MIME headers). A simple example urlCache is implemented that supports HTTP 1.1 (rfc2616) cache-control and expire headers to ensure freshness. Also included is an rfc2616 package useful for parsing HTTP 1.1 headers, and a PCache package implementing a persistant cache using a Python shelve.
|Tags||Communications Internet Web Software Development Libraries Python Modules|
|Operating Systems||OS Independent|
Release Notes: PCache.py was fixed to correctly handle cached negative-hits. A heartbeat was added to PCache.py's test code.
Release Notes: Support for smart caching of KeyErrors raised when the upsteam GSource indicates the requested object does not exist.
Release Notes: Memory efficiency and flexibility has been improved via major restructuring from MetaData class to GSource generic source, using metadata tuples. API changes have been made to allow for rsync style delta updates, as well as If-Modified-Since updates. A PCache.py persistant cache was added using shelve store, and a memtest1.py test script was added.
Release Notes: Initial release.