This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat Caching Issue" Watch "Tomcat Caching Issue" New topic
Author

Tomcat Caching Issue

Girdher Singh
Greenhorn

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 .

Thanks
Krishna Kanth
Ranch Hand

Joined: Oct 23, 2006
Posts: 49
    
    1

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: 16022
    
  20

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
 
subject: Tomcat Caching Issue