Thanks Chuck for that. Perhaps my use of words was a little misleading. I
guess what i was trying to say was that the response returned by Tomcat i.e
expiry date etc was not conductive to caching for clients. In terms of
headers, i dont want to cache 'pages as the data is very transient. What i
did want however was for Tomcat to serve the static resources with a header
that doesn't expire in 1970. The line 'can Tomcat cache resources' was i
guess trying to establish if Tomcat could treat them in a similar way to
Resin, in that you can specify in the web.xml elements to provide the kind
of solution i'm looking for but yes, ultimately it affects what header
information is 'stamped' on the response.

>> What are you doing to control the headers?  What headers are being used
>> for the large .js files?

Nothing, this is perhaps my problem, i (or at least think) know how to
specify headers on a page level but when it comes to specifying on static
resources i'm not sure how this all fits in?

>>>> i cant believe there isn't a standard Tomcat configuration for this?

>>For what?  Caching static resources on the server end doesn't alter the
amount of network traffic >>generated.

Sorry, 'cant believe' is perhaps a little strong, born from end of day
frustrations :) I'll rephrase....'it would be nice :), if i could specify
header expiry on a static asset similar to the way Resin does. Now, maybe
this comment still doesn't make sense so i'll step back a little. I have a
dynamic website, that uses a lot of javascript js files which seem to be
downloaded for every page call, i'd like this to stop :D.

Thanks again for your response, its certainly helping me focus the problem
:)






Caldarale, Charles R wrote:
> 
>> From: David Smith [mailto:[EMAIL PROTECTED]
>> Subject: Tomcat caching of static resources?
>>
>> is it possible to cache static images and .js files in Tomcat?
> 
> Think about what you just asked for: how would caching static resources in
> the server avoid them being downloaded by the browser?  It's the browser
> that must cache the information to avoid the redundant downloads.
> 
>> When i look at the browser cache it looks like the browser
>> is downloading all page assets for every call, including some
>> very large .js files.
> 
> As stated in one of the (correct) responses to the article you referenced:
> 
> "So the first thing is to get control of the cache headers. Without them,
> the cache can not know what to do."
> 
> What are you doing to control the headers?  What headers are being used
> for the large .js files?
> 
>> but the solution didn't resolve the problem (especially if
>> deploying via war files)
> 
> The original author of the article is clearly unfamiliar with Tomcat,
> caching, and security (e.g., not knowing where a context.xml file goes,
> and erroneously stating it doesn't work with a .war file).
> 
>> i cant believe there isn't a standard Tomcat configuration for this?
> 
> For what?  Caching static resources on the server end doesn't alter the
> amount of network traffic generated.
> 
>  - Chuck
> 
> 
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail
> and its attachments from all computers.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Tomcat-caching-of-static-resources--tp20932874p20953909.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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

Reply via email to