13

how to disable tomcat caching? I use this -

<Context antiJARLocking="true" antiResourceLocking="true" cachingAllowed="false" cacheMaxSize ="0" cacheTTL="1">

in Tomcat/conf/context.xml

but it not helps

Pascal Thivent
  • 562,542
  • 136
  • 1,062
  • 1,124
Ivan
  • 261
  • 1
  • 2
  • 6

4 Answers4

13

Actual problem is antiResourceLocking="true".

Looks like there is a conflict with cachingAllowed="false".

alain.janinm
  • 19,951
  • 10
  • 65
  • 112
Ivan
  • 261
  • 1
  • 2
  • 6
2

I'm not sure what you're using, but in context.xml you can change the value of cachingAllowed by removing the flag.

Remember to delete the cache folder after that.


Resources :

On the same topic :

Community
  • 1
  • 1
Colin Hebert
  • 91,525
  • 15
  • 160
  • 151
0

cachingAllowed did not help. I resolved this by modifying :

    $CATALINA_HOME/conf/Catalina/localhost/thewebapp.xml

which is the cached file of context.xml

amine
  • 320
  • 3
  • 7
0

Put below code in your sever.xml file.

<Context className="org.apache.catalina.core.StandardContext"
             cachingAllowed="false"
             charsetMapperClass="org.apache.catalina.util.CharsetMapper"
             cookies="true" 
             reloadable="false" 
             wrapperClass="org.apache.catalina.core.StandardWrapper">
    </Context>

Make sure to delete all data from /work/Catalina/localhost directory before restarting tomcat. Also clear your browser cache.

Its a good practice to disable browser caching while your app is in development. This post may help Disabling Chrome cache for website development

Community
  • 1
  • 1
Ravi Shekhar
  • 2,633
  • 4
  • 19
  • 19