Re: [need for advices] fastCaching
| From: | Tomas V.V.Cox | Date: | Mon, 22 Jul 2002 21:36:59 +0000 |
| Subject: | Re: [need for advices] fastCaching | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-7879@lists.php.net to get a copy of this message | ||
Brent Cook wrote:
>
> On Mon, 22 Jul 2002 fabien.marty@free.fr wrote:
>
> > > A quick review of the code shows no handling of corrupt cache files.
> > > I suggest writing the file length into the cache file and some
> > > signature
> > > bytes
> > > as a prefix/suffix to the cache data to ensure data integrity.
What about to have the md5 of the data as part of the file name?
> > With FileLocking on (default), it's very very difficult to have
> > corrupted cache files. But adding a test is possible. A md5 hash would
> > be perfect but we would have to do some benchs. Because adding only file
> > length has to be faster I think.
> >
> > Fabien
>
> I've had instances of corrupt cache on Digital Unix using NFS pretty
> often (mostly empty files), so this is important, though it could be
> optional.
> - Brent
>
You may want to read the big Warning about flock() in the manual :-).
Perhaps we could implement some application level lock ala Netscape (it
may be nice for the installer too). Or well, md5() sounds good too.
Tomas V.V.Cox