HTTP caching headers settings weblogic

泄露秘密 提交于 2019-12-10 17:52:53

问题


Does anyone know how to modify weblogic settings to set the HTTP cache header to a far future date?

For example in my current setup weblogic sets the http cache headers to expire in 5 hours (as a response of HTTP/1.1 304 Not Modified).

This is the cache header value on a .gif file ... Date: Tue, 16 Mar 2010 20:39:13 GMT.

I have re-checked and it's always 5 hours. There must be some for of settings that I can tweak to change it.

Thanks for your time!


回答1:


Static content is served by a weblogic.servlet.FileServlet that all web applications have by default but I couldn't find any way to configure HTTP headers. So either replace this servlet with your own servlet or use a Filter.

But the above comment is right, using a web server to serve static content is the "right" way to go: a web server does a better job at this and the application server has other things to do than serving static files.




回答2:


You can use this property :

    <wls:container-descriptor> 

    <wls:resource-reload-check-secs>-1</wls:resource-reload-check-secs> 

   </wls:container-descriptor> 

The element is used to perform metadata caching for cached resources that are found in the resource path in the Web application scope. This parameter identifies how often WebLogic Server checks whether a resource has been modified and if so, it reloads it.

The value -1 means metadata is cached but never checked against the disk for changes. In a production environment, this value is recommended for better performance.



来源:https://stackoverflow.com/questions/2457984/http-caching-headers-settings-weblogic

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!