aspose file tools*
The moose likes Tomcat and the fly likes Tomcat & javascript browser caching Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat & javascript browser caching" Watch "Tomcat & javascript browser caching" New topic
Author

Tomcat & javascript browser caching

Konstantin Netkachev
Greenhorn

Joined: Jul 24, 2009
Posts: 15
Our Java web application works on Tomcat 6. Most of user use FireFox.

We faced a problem. After changing javascript files on server, they allways taken from browser cache on client side and doesn't updated auromaticaly from server. Only CTRL+F5 resolves that but users don't know it and allways swear at errors.

Is there possibility to somehow resolve this problem? May be to change some tomcat configurations?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15624
    
  15

You can control client caching by adjusting the cache headers sent back with the response to the JavaScript resource requests, up to and including "no-cache". You can force a change by including a version ID as part of the URL, since caching is based on the URL itself and not on the returned content.

For production systems, cache is generally preferable, since things like JavaScript, CSS, and many images are not usually very changeable. In cases where you are dynamically creating the contents of the returned JavaScript, that's another matter.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat & javascript browser caching
 
Similar Threads
JavaScript help needed!
Resolution Detection with JSP
Problem with Work folder
how to create timer in jsp?
I didn't understood the term javascript Engine, What does it mean.