启用J2EE Web应用程序资源的缓存
如何控制Web应用程序的资源处理?
How can I control my web application's resource handling?
我的用户具有极高的延迟时间(〜1s!),我必须在这样的环境中测试我的应用程序.我立即看到的是,我的资源(css和图像文件)总是在每个页面上重新加载,可能是因为响应头包含一个Expire标记,该标记不允许任何浏览器缓存.
I have users with extremely high latency times (~1s!) and I must test my application in such environments. What I can see right away is that my resources (css and image files) are always reloaded on every page, probably because the response header contains an Expire tag that does not allow for any browser caching.
我如何知道?资源适配器?将其设置为合理的值?还有其他方法可以改善不良的延迟影响吗?
How can I tell the ?resoure adapter? to set it to some reasonable value? Are there any other ways to improve bad latency effects?
环境:Glassfish v3,JSF2和Primefaces.
Environment: Glassfish v3, JSF2 and Primefaces.
我发现了这一点:
http://code.google.com/p/xebia-france /wiki/ExpiresFilter
它可以工作,但不适用于启用了安全性的资源,因为Glassfish会自行设置Expires标头.
it works, but not for security-enabled resources, where Glassfish sets the Expires header on its own.
这是另一有用的信息(正在使用安全约束..." 部分):
This is another useful bit of information (the "Using Security Constraints..." section):
我将重述有关Glassfish和资源的问题.
I will rephrase my question concerning Glassfish and resources.