【问题标题】:How to force browser to cache the page in websphere portal如何强制浏览器在 websphere 门户中缓存页面
【发布时间】:2012-05-22 12:47:45
【问题描述】:

我可以强制浏览器缓存 WPS 6.1 响应的页面吗?

强制浏览器缓存页面是满足要求的一种方式吗?

我尝试创建一个过滤器并在 wps 中对其进行配置。

<filter>
   <filter-name>Cache Filter</filter-name>
   <filter-class>com.samaxes.filter.CacheFilter</filter-class>
   <init-param>
       <param-name>expirationTime</param-name>
       <param-value>120</param-value>
   </init-param>
</filter>
<filter-mapping>
   <filter-name>Cache Filter</filter-name>
   <url-pattern>/portal/*</url-pattern>
</filter-mapping>

它正在工作,但 HTTP 标头仍在:

缓存控制无缓存
内容-语言 en-US
内容类型文本/html;字符集=UTF-8
日期 2012 年 5 月 11 日星期五 07:50:19 GMT
有效期至 1970 年 1 月 1 日星期四 00:00:00 GMT
IBM-Web2-Location ...
编译指示无缓存
服务器 WebSphere Application Server/6.1 传输编码分块
改变用户代理、Cookie
如何获得正确的响应头?
缓存控制:max-age=120
过期:

谢谢

【问题讨论】:

    标签: websphere browser-cache websphere-portal


    【解决方案1】:

    在尝试缓存整个页面时应注意的一点是,门户页面的 URL 是状态感知的。这意味着,如果您更改门户会话的状态,那么即使您在同一页面上,也会出现不同的 URL,从而导致缓存变得困难。

    但是,这里有一个链接,介绍如何使用 Portal 中内置的机制启用这种类型的缓存。作者确实注意到,即使他在浏览器中看到缓存条目和正确的缓存标头,浏览器仍在向服务器发出请求。

    http://wpcertification.blogspot.com/2010/08/how-to-cache-portal-page-in.html

    编辑: 在缓存页面上包含指向 Portal 6 特定文档的链接,因为我认为上面的博客专注于 Portal 7

    http://publib.boulder.ibm.com/infocenter/wpdoc/v6r0/index.jsp?topic=/com.ibm.wp.ent.doc/wpf/tune_cache.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-06-07
      • 2021-02-10
      • 2020-11-14
      • 1970-01-01
      • 2011-10-11
      • 2015-07-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多