Search code examples
cachingjbossjboss6.xexploded

Clear web pages cache in jboss


I develop a web app:

  • frontend javascript
  • transport json
  • backend Java EE
  • JBoss AS 6.1

All static html and js files are in an exploded .war directory which itself is in an exploded .ear directory.

Normally everything works fine! Today I changed a html file and copied it to the .war directory.

When the browser loaded the file it was the old one. So I started wireshark and saw in wireshark the get request and the returned OLD file, even when I changed the filename in the .war directory.

So there is some caching in jboss. I started Googling and found some posts about the tmp and work folders.

I looked in my "...\server\default\work..." folders, but everything was empty.
In "...\server\default\tmp" I found some files but no one seems to be related to my cached page.


Solution

  • As this is a tomcat-in-jboss issue, you have to go to the tomcat area in jboss. In my case ..\server\default\deploy\jbossweb.sar. In this directory you should find a file called context.xml.

    Now stop jboss.

    In the context tag there are 2 attributes - cookies and crossContext. Now just add the attribute cachingAllowed="false" and start jboss again:

    <Context cookies="true" crossContext="true" cachingAllowed="false">