Tomcat DOES return ETag headers with static resources, and DOES NOT
return the ETag with 304 responses. That seems wrong according to the
quoted part of the spec.

Here are the headers from a couple of Firefox requests for the same
file. Note the first response is a 200 with an ETag, the second is a
304 without an ETag.
----------------------------------------------------------
http://localhost:8080/tomcat.gif

GET /tomcat.gif HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.8.0.11) Gecko/20070312 Firefox/1.5.0.11
Accept: 
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: ShowOptions=1; loadDefault=Folder
Pragma: no-cache
Cache-Control: no-cache

HTTP/1.x 200 OK
Server: Apache-Coyote/1.1
Etag: W/"1934-1173108368046"
Last-Modified: Mon, 05 Mar 2007 15:26:08 GMT
Content-Type: image/gif
Content-Length: 1934
Date: Fri, 18 May 2007 15:16:46 GMT
----------------------------------------------------------
http://localhost:8080/tomcat.gif

GET /tomcat.gif HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.8.0.11) Gecko/20070312 Firefox/1.5.0.11
Accept: 
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: ShowOptions=1; loadDefault=Folder
If-Modified-Since: Mon, 05 Mar 2007 15:26:08 GMT
If-None-Match: W/"1934-1173108368046"
Cache-Control: max-age=0

HTTP/1.x 304 Not Modified
Server: Apache-Coyote/1.1
Date: Fri, 18 May 2007 15:16:46 GMT
----------------------------------------------------------
--
Len

On 5/18/07, Reich, Matthias <[EMAIL PROTECTED]> wrote:
Hi,

the spec says that a 304 response MUST include header

- ETag and/or Content-Location, if the header would have been sent
        in a 200 response to the same request

Does Tomcat send an ETag header in a 200 response when it serves static
content?
If not (and I assume that it doesn't), I read the spec in a sense that
it is o.k. for the 304 response not to include an ETag.

For static content, last modified information usually is sufficient to
decide whether a cache entry is still valid, so what additional should
an ETag header deliver in that case?


Regards,
Matthias


> -----Original Message-----
> From: Rashmi Rubdi [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 18, 2007 3:10 AM
> To: Tomcat Users List
> Subject: Re: Missing ETag in 304 Header
>
> On 5/16/07, Joe Mun <[EMAIL PROTECTED]> wrote:
> > Hi guys... so according to the HTTP 1.1 spec (
> > http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html),
> 304 Not Modified
> > responses must include the ETag in the header.  However,
> Tomcat doesn't seem
> > to be adding it...
> >
> > I am serving a static text file, and the header only returns:
> >
> > HTTP/1.x 304 Not Modified
> > Server: Apache-Coyote/1.1
> > Date: Wed, etc...
>
> I examined the header returned by Tomcat 6.0.10 with Firefox's
> TamperData extension and also by uncommenting Tomcat's
> RequestDumperValve.
>
> You are right that the ETag header doesn't appear.
>
> However, I saw another cache related header "if-none-match" , which
> also shows a checksum in the same format as ETag , perhaps you may
> find that header useful.
>
> May 17, 2007 9:01:46 PM
> org.apache.catalina.valves.RequestDumperValve invoke
> INFO:             header=if-none-match=W/"6958-1163795820656"
>
> I don't really know what causes the ETag to appear, I would expect it
> to appear by default without any configuration similar to many other
> HTTP Caching Headers.
>
> I did notice the ETag for static files on one website that is hosted
> on Apache httpd + Tomcat.
>
> > Is there a reason that the Etag is not being included?  Is
> there a way to
> > configure Tomcat to include this? My company is working
> with a caching
> > solution provider, and they are complaining about the missing ETag.
> >
> > thanks.
> >
>
> Regards
> Rashmi
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to