缓存liferay中所有页面的过期时间

时间:2017-09-13 18:13:32

标签: caching liferay

是否可以在liferay中为整个页面设置缓存过期时间? 我找到了下一个解决方案但它在浏览器中根本禁用了缓存。是否可以设置整页的到期时间?

#
# Set this to true if you want the portal to force the browser cache to be
# disabled. It will only disable the cache for the rendered HTML response.
# It will not have an impact on static content or other resources.
#
browser.cache.disabled=true

#
# Set this true if you want to disable the cache for authenticated users.
# This property is not read when the property
# "browser.cache.signed.in.disabled" is true. This is useful to ensure that
# authenticated users cannot go to the sign in page by clicking on the back
# button in their browsers.
#
browser.cache.signed.in.disabled=true

1 个答案:

答案 0 :(得分:2)

您可以设置'过期'标题配置liferay HeaderFilter 过滤器:

Liferay过滤器在 WEB-INF / liferay-web.xml 中配置,默认配置为:

开箱即用,Liferay只为某些网址格式添加了“Expires”和“Cache-control”标题,请参阅:

所以你必须创建:

  1. 包含您要添加的标题的新过滤条目
  2. 使用您要修改的网址进行新的过滤器映射