Re: Cache directory tagging

Bryan Ford <[email protected]> Mon, 16 Aug 2004 20:30:05 +0200
Newsgroups gmane.comp.web.galeon.devel
Organization Massachusetts Institute of Technology
Message-ID <[email protected]>
On Monday 16 August 2004 19:27, Tommi Komulainen wrote:
> On Mon, 2004-08-16 at 18:57 +0200, Bryan Ford wrote:
> > Hi Galeon folks,
> >
> > I've been talking with the Mozilla folks and other projects for a few
> > weeks about a proposal I'm circulating, available here:
> >
> > 	http://www.brynosaurus.com/cachedir/
>
> Maybe it's just me, but it seems not all possible cases are mentioned
> which makes me wonder if they were overlooked.  For example, what if the
> user explicitly removes *only* the tag file?  Or edits the contents?
> What should the applications do in those cases?

Since the cache directory is application-managed, I figured I'd leave the 
exactly management details up to the application.  In the Mozilla 
implementation, all it does is open and write a branch-new cache tag file 
each time Mozilla starts up and initializes the cache, without even checking 
if a tag was there already.  So if the user deletes the tag or edits its 
contents, the tag file will be reverted on the next startup.  But frankly I'm 
not all that worried about exactly what happens if the user starts mucking 
around in the cache directory, since with most applications that can probably 
lead to serious weirdness in other respects anyway.

> > The short version: I'm proposing that applications that automatically
> > create and maintain cache directories of some kind include a trivial
> > little "tag" file in the directory with a standard name and header, to
> > provide a robust and standard way to exclude those directories from
> > backups and such.  Mozilla and several other projects are already on
> > board.  (In fact I already contacted Ricardo Pascual about this a while
> > ago, who referred me to this list, but didn't have a chance to follow up
> > until now.)
>
> I put this in bugzilla as well:
> http://bugzilla.gnome.org/show_bug.cgi?id=150277

Thanks!

> > Implications for Galeon: Since you already inherit Mozilla's web content
> > cache code, that cache directory should be taken care of next time you
> > update to Mozilla's latest code base.  But I notice that Galeon also
> > creates a "favicons-cache" directory - assuming it's really a cache
> > (which it appears to be), would you be willing to add the 5 or 10 lines
> > of code necessary to write a tag file into this directory as well?
>
> Seems quite unobtrusive to add, I don't see any reason why we couldn't
> add that.  Maybe you could even write a reference implementation in the
> spec everyone else could just copypaste?  What me lazy? ;)

Good idea!  I'll at least add some pseudocode to the next version...

Cheers,
Bryan


-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285