Thanks for the info. By setting the caching for the resources, with max-age,
IE only asks for the resources after the time has expired which is probably
why I am not seeing the 304s. I also cross test with FireFox and Mozilla and
they work the same when the cache settings are set as well, although when
they are not set they work much better.

Keith

-----Original Message-----
From: Dennis Dai [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 30, 2004 7:18 PM
To: Tomcat Users List
Subject: Re: How do you set cache-control for static (gif, jpg) resources


Keith,

This is on one of my development servers. I'm mostly using 
Mozilla/Firefox, which generate those 304 log entries.

For Internet Explorer, it generates those 304s only after I set the 
temporary Internet files to "Every visit to the page" which is not the 
default. It doesn't even make the request for those static contents with 
the default settings which is "Automatically". FYI, I'm using IE6 SP1 on 
Windows 2000 Pro with security patch. Don't know how other versions of 
IE behave though.

Dennis

On 7/30/2004 3:08 PM, Keith Bottner wrote:

> Dennis,
> 
> May I ask what client specifically is accessing your server? The 
> client can actually send an If-Modified-Since field with its request 
> and the 304 would be the response if it had not been modified since 
> that specified date/time. Some intermediary caches (proxies) use this 
> as a more efficient method of caching. And depending on what 
> information was returned with the previous get determines what clients 
> may query. Specifically my problem was with Internet Explorer, it 
> which case it does not send an If-Modified-Since it just requests the 
> resource. Still not crystal clear on all of this but, the solution I 
> settled on seems to work.
> 
> Keith
> 
> 
> 
> -----Original Message-----
> From: Dennis Dai [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 30, 2004 3:07 PM
> To: Tomcat Users List
> Subject: Re: How do you set cache-control for static (gif, jpg) resources
> 
> 
> I've been reading this thread back and forth for quite a few times :)
> 
> My observations are tomcat does send response code 304 on static
> contents (.js, .jpg, .gif, etc.), so I don't know why you said "Tomcat 
> always returns Cache-Control: no-cache with every response" at the very 
> beginning of this thread. Well I haven't done any request dump to see if 
> that's the case, but I do see lots of 304s in my access log (which, I 
> assume, is not quite possible if it sets Cache-Control to no-cache with 
> every response).
> 
> Speaking of cache, there was an onJava article about caching with
> filter, but that's mostly for caching dynamically generated pages, which 
> may or may not be of interests to you guys:
> 
> http://www.onjava.com/pub/a/onjava/2003/11/19/filters.html?page=3
> 
> 
> Regards,
> 
> Dennis
> 

-- 
Dennis Dai
[EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to