Projects / pyGCache

pyGCache

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
Licenses
Operating Systems
Implementation

Recent releases

  •  18 Feb 2002 15:06

    Release Notes: PCache.py was fixed to correctly handle cached negative-hits. A heartbeat was added to PCache.py's test code.

    •  12 Dec 2001 22:57

      Release Notes: Support for smart caching of KeyErrors raised when the upsteam GSource indicates the requested object does not exist.

      •  17 Nov 2001 07:07

        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.

        •  16 Nov 1999 04:56

          Release Notes: Initial release.

          Recent comments

          16 Oct 2006 13:12 abo

          Re: possible conflict between this and GTK+ objects


          >

          > % Probaby this project should have it's

          > name changed to

          > % pyGCache...

          done. Also licence changed to LGPL.

          16 Apr 2003 06:14 jeffcovey

          Re: possible conflict between this and GTK+ objects

          > Probaby this project should have it's name changed to
          > pyGCache... hmm now how do I go about that...

          Use the "update project" function on the "[Project]" menu.

          16 Apr 2003 02:42 abo

          Re: possible conflict between this and GTK+ objects

          [...]
          > I'm afraid that someday this project and
          > python port of GTK+ make conflict over
          > names.


          I just got an email enquiring about a gcache failure in apache and the apache-ssl module. Is this the GTK+ gcache, or yet another one?

          Probaby this project should have it's name changed to pyGCache... hmm now how do I go about that...

          03 Mar 2003 12:51 keizie

          possible conflict between this and GTK+ objects
          GTK+ has GLib the good set of objects and functions.
          and GLib 2 provide GCache and GSource, etc.
          I'm afraid that someday this project and python port of GTK+ make conflict over names.

          20 Nov 2001 18:50 abo

          Version 1.7 much better.
          The version 1.7 significantly re-structured GCache from the previously released 0.1. The MetaData class is gone, instead a GSource class is used to create generic sources that produce (meta,data) tuples. New caches are no-longer implemented by inheriting from GCache and defining source_get methods, instead, GCache instances are created with a GSource instance parameter that implementes the upstream source interface.

          This significantly cleans up the class heirachy, making everything simpler and more powerful. Defining GSource source's for a cache is much simpler, making GCache easier to use. Note that GCache is itself inherited from GSource, allowing for GCache instances to have other GCache instances as their source, allowing for cache heirachys.

          The use of tuples and integer timestamps has significantly reduced the memory overheads. The dependance on PQueue has been removed by providing an optional pure Python implementation of PQueue. A persistant PCache has also been provided that incidentaly also reduces the memory overhead by storing cache contents in a shelve.

          The API has also been significantly changed to allow for any sort of refresh-update, including rsync style delta updates as well as If-Modified-Since fetches. All of this is hidden behind the simple Python dict interface.

          Screenshot

          Project Spotlight

          OpenStack4j

          A Fluent OpenStack client API for Java.

          Screenshot

          Project Spotlight

          TurnKey TWiki Appliance

          A TWiki appliance that is easy to use and lightweight.