[dev] Re: [cvs] commit: horde/docs CHANGES horde/lib Cache.php horde/lib/Cache file.php

Anil Madhavapeddy anil@recoil.org
Mon, 20 Aug 2001 15:02:58 +0100


On Mon, Aug 20, 2001 at 11:01:24AM +0200, Jan Schneider wrote:
> Why don't we use the pear cache library?

I looked at it.

- we can wrap the Horde one around the PEAR caching system
  easily by writing a driver 

- its API isnt designed to be used as an object repository
  with multiple expiration heuristics

- no file/table locking, means that it isn't reliable.
  My filesystem driver doesnt do locking, but I dont _think_
  it needs to - feel free to poke holes in my logic.

  - Try to store an object A
  - Write into /var/cache/horde/_tmp_file and register
    it for cleanup
  - Rename /var/cache/horde/_tmp_file to chora_md5_of_A

  After this rename, the cleanup register no longer happens
  and the change becomes permanent.  Also, the rename is
  an atomic operation.

  Also, the request can be terminated at any time, and 
  the cache will be in a coherent state.  It prefers to
  flush the object from the cache than to have a half
  written object.

> I didn't take a look at but and therefore don't know 
> if this one fits your > needs, but we probably shouldn't
> event the wheel another time as we have an uptodate 
> pear repository anyway.

Equally, I'm very very reluctant to put a depencdency on
PEAR-cvs, as this would mean that the stable release of
Horde is delayed by another 2-3 months (see my next mail)

Anil