Set cache expiration?

后端 未结 3 1934
醉梦人生
醉梦人生 2020-12-02 20:43

I tested my site with Chrome and got the following recommendation:

The following resources are missing a cache expiration. Resources that do not specify an e         


        
3条回答
  •  情深已故
    2020-12-02 21:23

    If this question pertains to caching of javascript or css that are a part of your tomcat application directory; you may like to examine the /conf/web.xml file.

    Typically the mime mapping available here is

       js
       application/javascript

    In apache the default directive is
       ExpiresByType text/javascript "access plus "

    You may like to change the apache directive to application/javascript or change the tomcat mime mapping to text/javascript and this will set the expiration to your timeframe.

提交回复
热议问题