jQuery in Action, 3rd edition
The moose likes Tomcat and the fly likes Tomcat Caching Issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat Caching Issue" Watch "Tomcat Caching Issue" New topic

Tomcat Caching Issue

Girdher Singh

Joined: Feb 12, 2012
Posts: 12
Hello everyone,

I am working on the development of a web application,as of now I am using Tomcat Server.I found that when I am doing some changes in the jsp files and wanted to see the changed things in the web application then at that time tomcat server is showing the older version of the jsp files.I also cleared the Catalina folder in under tomcat/work/Catalina.also before starting the tomcat server I did clear the tomcat module directory.

Please provide me what ever information you guys know about the tomcat caching .

Krishna Kanth
Ranch Hand

Joined: Oct 23, 2006
Posts: 49

May be its the mozilla cache on client side?

P.S: I said mozilla, because i have seen this issue more in Mozilla Firefox and less in Chrome.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17421

There are two types of caching under consideration here.

When a JSP is first processed, it is converted to java code, compiled, and then the compiled code is stored under TOMCAT_HOME/work. You can consider this a cache, if you like, but it's not a cache of the page, it's a cache of the code. Deleting the files under Tomcat's work directory will clear it (best done when Tomcat is offline).

The other type of caching is for a specific rendering of a webpage. The same JSP, after all, can be involved in the display of 2 entirely different database queries. The image of this page can be cached.

webpage caching is never done by Tomcat. It is always done (if at all) by the client. You can often force a refresh by pressing your browser's "F5" key (or ALT+R). A more extreme method would be to forcibly flush the entire browser cache via the appropriate browser Preferences menu option.

Caching should normally only occur if a cache directive is part of your outgoing HTTP response for the page. And, in fact, Tomcat will shut off caching when the response is encrypted. So it's a good idea to use FireBug or whatever similar mechanism is available on your browser of choice to examine the returned headers and adjust them if necessary.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link: http://aspose.com/file-tools
subject: Tomcat Caching Issue
It's not a secret anymore!