how to disable tomcat caching?

2019-01-17 04:29发布

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

4条回答
相关推荐>>
2楼-- · 2019-01-17 05:08

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

查看更多
forever°为你锁心
3楼-- · 2019-01-17 05:12

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 :

查看更多
Melony?
4楼-- · 2019-01-17 05:19

Actual problem is antiResourceLocking="true".

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

查看更多
虎瘦雄心在
5楼-- · 2019-01-17 05:23

cachingAllowed did not help. I resolved this by modifying :

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

which is the cached file of context.xml

查看更多
登录 后发表回答