how to disable tomcat caching?

后端 未结 4 2092
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-08 12:16

how to disable tomcat caching? I use this -



        
相关标签:
4条回答
  • 2020-12-08 12:42

    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

    0 讨论(0)
  • 2020-12-08 12:56

    Actual problem is antiResourceLocking="true".

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

    0 讨论(0)
  • 2020-12-08 13:01

    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 :

    • Apache Tomcat Configuration Reference

    On the same topic :

    • How do I disable tomcat caching? I'm having weird static file problems.
    0 讨论(0)
  • 2020-12-08 13:08

    cachingAllowed did not help. I resolved this by modifying :

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

    which is the cached file of context.xml

    0 讨论(0)
提交回复
热议问题