启用J2EE Web应用程序资源的缓存 [英] Enable cache of J2EE web application's resources

查看:109
本文介绍了启用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):

http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/ui/ImageBundle.html

我将重述有关Glassfish和资源的问题.

I will rephrase my question concerning Glassfish and resources.

这篇关于启用J2EE Web应用程序资源的缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆