How to configure cache for static resources in web.xml for Jetty?

前端 未结 1 517
栀梦
栀梦 2021-02-08 10:07

I was reading this: http://docs.codehaus.org/display/JETTY/LastModifiedCacheControl

It says

The Jetty default servlet allows the cache control hea

相关标签:
1条回答
  • 2021-02-08 10:47

    Need to add the following to your web.xml

    <servlet>
        <servlet-name>default</servlet-name>
        <servlet-class>org.mortbay.jetty.servlet.DefaultServlet</servlet-class>
        <init-param>
            <param-name>cacheControl</param-name>
            <param-value>max-age=3600,public</param-value>
        </init-param>
    </servlet>
    
    0 讨论(0)
提交回复
热议问题