W3C home > Mailing lists > Public > www-jigsaw@w3.org > January to February 2002

Re: help with cache

From: Christopher William Turner <cwturner@cycom.co.uk>
Date: Sun, 20 Jan 2002 13:34:25 +0000
Message-ID: <3C4AC761.F171E63F@cycom.co.uk>
To: Stephane Nicoll <stephane.nicoll@skynet.be>
CC: www-jigsaw@w3.org

> 1) Is it possible in a filter to get the file that is being served?
The file content will be on an inputstream. You can read this to
completion yourself, save to your own database, then recreate
a new inputstream that is a copy of the orginal and give to
the rest of the filter stack.

How can we retrieve something in the cache, based on the URL?
Use a database or hash table. You may want to standardise or ignore
any time dynamic parts of a URL such as jsessionId.

> 3) How does the cache stores dynamic file (such as
> www.site.com/search?q=toto&titi;jsessionId=1234564 )
You don't need to know. You will write your own cache
mechanism which ignores the time or session related parts of
the request (since they will may change on replay and you still
want a cache hit. You should add a sequence number to the key when
you cache content, so that dynamic and changing content (from a constant
url) is served in the correct sequence (keep a count).

> 
> My problem is that I want to STORE everything the user browses ... (is for
> an e-learning tool). I think I'll be problems when no-cache header is
> activated ...
No problem, your filters should be before jigsaws caches and will
ignore the nocache headers.

Just do it, build in tracing, and fix problems as they arise.

You could even write your own proxy from scratch. Its just
bytes on port 80 and the urls are line 1!

> 
> Thanks and regards,
> 
> Stéphane

-- 
Christopher William Turner, http://www.cycom.co.uk/ "Serving fine Java
since 1996"
Received on Sunday, 20 January 2002 08:48:17 GMT

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