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

cached HTTPResource attributes

From: Anselm Baird_Smith <abaird@www43.inria.fr>
Date: Mon, 25 Nov 1996 10:39:28 +0100 (MET)
Message-Id: <199611250939.KAA20867@www43.inria.fr>
To: Jason Hoos <jhoos@uiuc.edu>
Cc: www-jigsaw@w3.org
Jason Hoos writes:
 > I'm looking through the HTTPResource class right now, and I've noticed that 
 > there are several variables for cached copies of attributes such as 
 > "contenttype", "contenetlength", "lastmodified", and several others.  It 
 > appears that these are updated by calling updateCachedHeaders(), and are set to 
 > null if they are outdated by setValue().  Supposedly this is provided so that 
 > these values can be accessed quickly without going through the attributes. 
 > 
 > My question is, why don't the various getContentType(), getContentLength(), 
 > etc. methods of HTTPResource actually use any of them?

Your initial assumption is not exactly true. The updateCachedHeaders
duty is to update cached header values. HTTP header values are
expensive to generate (they all involve a transformation of some piece
of data into a String). Cached header values try to avoid recomputing
this transformation each time.

Attribute holds tha value in its "native" format (eg ContentLength is
an int). Cached header values cache values in their HTTP wrapper (so,
for example, the content length is stringified only once).

Hope this helps,
Anselm.
Received on Monday, 25 November 1996 04:39:47 GMT

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