头文件中的缓存控件在使用rails3的safari中不起作用

时间:2013-10-04 12:55:29

标签: caching safari cache-control

我正在rails3中构建一个应用程序。我想在我的应用程序中阻止缓存。 我在应用程序控制器中添加了以下代码:

before_filter:set_cache_buster

 def set_cache_buster
     response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"
    response.headers["Pragma"] = "no-cache"
    response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
  end

使用firefox,chrome可以正常工作。但它不适用于safari。

我还在我的application.html中尝试了

body onunload="" 
,但仍未取得成功。

任何人都知道如何防止Safari中的缓存?请帮忙。

0 个答案:

没有答案