W3C home > Mailing lists > Public > www-jigsaw@w3.org > November to December 1996

Re: Database as proxy cache

From: Anselm Baird_Smith <abaird@www43.inria.fr>
Date: Mon, 4 Nov 1996 09:07:33 +0100 (MET)
Message-Id: <199611040807.JAA00878@www43.inria.fr>
To: Mark Friedman <mark@intraspect.com>
Cc: www-jigsaw@w3.org
Mark Friedman writes:
 > 
 > On Thu, 31 Oct 1996 10:13:01 +0100 (MET) Anselm Baird_Smith 
 > <abaird@www43.inria.fr> wrote:
 > 
 > > Mark Friedman writes:
 > >  > I wonder if I could get some specific details on how I could extend (or 
 > >  > change) Jigsaw to enable the proxy cache pages to be cached in a database?
 > > 
 > > I am not sure where you want to use a database ? Is it (a) for cached
 > > entries, or (b) for pages content.
 > 
 > For starters, I'm unsure what exactly is in the cached entries. Is it the 
 > basically just the metadata? What is the relationship between what is in 
 > CacheFilter and CachedResource? 

The CachedResource contains only metadata (and a file attribute
giving the full pathname of the file in which the resource's content
is saved.

The CacheFilter is the client side filter (same idea as in the server
side, except that it applies to the client side). It "catches" any
request. tries to fullfill in from the cache (in its ingoing method),
and otherwise "enhance" the request for better caching. It then
catches (and save) the reply through it's outgoing method).

 > In any case I probably want to save (a) and (b) in my database.
 > 
 > > If (a) the best way is to write a resource store implementation that
 > > uses jdbc to connect to a database (check the
 > > w3c.jigsaw.resources.ResourceStore interface).
 > 
 > Well, I'll be using an OODB but I know about that part of things. Is there 
 > anything I should know about how to implement a ResourceStore that isn't 
 > mentioned in ResourceStore.java?

I don't think so, but I guess you will be one of the first to try to
do that, so any comments wellcome (I'll be glad to help you offline
for the details, if needed).

 > > 
 > > If (b), its even easier: each cached entries has a filename attribute
 > > giving the file where the content for that entry is stored.
 > 
 > Are you referring to the ATTR_FILE in CachedResource?

Yes.

 > > You need
 > > to change that to some ref into your database of the content, and then
 > > change slightly the CachedResource class to fetch the content from the
 > > db instead of a file.
 > 
 > Could I get some more specific guidance here? Do I need to define a new 
 > attribute type and create get and put methods for it? is there anything else 
 > I need to do? It looks like if I created streams for accessing and modifying 
 > the database then I could reuse a lot of the existing CachedResource code. 
 > Am I on the right track, or did you have something better in mind? 

I guess that's the idea, you probably need to define a new attribute
(which would eventually replace the ATTR_FILE). This new attribute
will allow you to retreive the content of the resource from the
database.

 > Also, I'm confused by the the use of both the relationship of CachedResource 
 > and the jdbmResourceStore. Could someone explain this a little?

Normally they should have no special relationship (ie the CacheFilter
should be able to use the SimpleResourceStore instead of the
jdbmResourceStore). If they are dependencies, they are either due to
bugs or lack of time, I'll be more then happy to remove them.

 > > 
 > > Does this helps ?
 > 
 > It does, but I might need a little more handholding because I'm not sure of 
 > the relationship of the various cache pieces and how they fit into the 
 > general Jigsaw framework.

Don't hesitate to ask more questions,
Anselm.
BTW: Are you using JDBC to get your hands to your OODB?
Received on Monday, 4 November 1996 03:07:42 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:25 GMT