W3C home > Mailing lists > Public > www-lib@w3.org > October to December 2000

Re: Getting the right content type for cached objects

From: <jose.kahan@w3.org>
Date: Wed, 13 Dec 2000 12:06:36 +0100 (MET)
Message-Id: <200012131106.MAA10354@tuvalu.inrialpes.fr>
To: "Thorsten Conradi conradi@kidata.de" <conradi@kidata.de>
CC: www-lib@w3.org
Hello Thorsten,

In our previous episode, Thorsten Conradi conradi@kidata.de said:
> I encounter the follwing problem (bug?)
> My application makes simple http requests and uses
> a cache. When I get the document via http, the
> mime-type is OK, but when I get the document from
> cache, the content-type is set to www/unkown.
> Some IMPORTANT details:
> - In the cache-meta-file, the content is set correctly
> - I use the method (in the afterFilter)
>       HTResponse_format(pResponse);
>   to get the (wrong) type.
> - When I use
>       HTAnchor_format(HTAnchor_parent(m_pHTAnchor));
>   I get the right type.
> My conclusion:
> Either the use of HTResponse_format(pResponse) is not
> well defined in the context of cached objects and I'm only
> to dum to find it in the docu or there might be a bug...

Yes, it is a bug. I have the same problem. When you get something from the
cache, the HTResponse object is not initialized using the headers found
in the the cache. These headers are only copied to the HTAnchor object.

I'm going to write a function to copy the headers to the response object
when the cache calls CacheCleanup() with a HT_NOT_MODIFIED status.

I just patched Amaya so that if if finds an HTResponse with content-type
unknown, it'll then try to get the content-type from the anchor object.
Of course, the best safe solution is to get it from HTResponse and not do
these patches :)

Received on Wednesday, 13 December 2000 06:06:45 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:33:53 UTC