【问题标题】:GWT *nocache* and deploying app in Jetty 7GWT *nocache* 和在 Jetty 7 中部署应用程序
【发布时间】:2012-03-03 15:52:43
【问题描述】:

在this gwt web 中说要放置这样的 *.htaccess 配置文件以避免缓存主要的 javascript gwt 应用程序。

<Files *.nocache.*>
  ExpiresActive on
  ExpiresDefault "now"
  Header merge Cache-Control "public, max-age=0, must-revalidate"
</Files>

<Files *.cache.*>
  ExpiresActive on
  ExpiresDefault "now plus 1 year"
</Files>

有没有办法对 Jetty 做同样的事情? (无需使用 httpd jetty 模块)

【问题讨论】:

    标签: gwt jetty no-cache


    【解决方案1】:

    此答案显示了如何为 Jetty 提供的所有文件禁用/启用缓存:

    How to prevent caching of static files in embedded Jetty instance?

    我认为要为单个文件(例如 nocache)设置自定义缓存设置,必须使用过滤器并在 HttpResponseObject 中为匹配请求 URI 的文件手动设置标题,如下所述:

    Servlet filter for browser caching?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-14
      • 2012-03-25
      • 2023-03-18
      • 1970-01-01
      • 2011-10-20
      • 1970-01-01
      相关资源
      最近更新 更多