Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/63.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 在rails中设置过期标头_Ruby On Rails_Ruby On Rails 3 - Fatal编程技术网

Ruby on rails 在rails中设置过期标头

Ruby on rails 在rails中设置过期标头,ruby-on-rails,ruby-on-rails-3,Ruby On Rails,Ruby On Rails 3,我的应用程序控制器中的before_过滤器中有以下内容: def response_headers response.headers["Expires"] = CGI.rfc1123_date(Time.now + 1.year) end 但是根据YSlow的说法,仍然没有设置任何expire头。有什么想法吗?如果您使用curl-I检查会发生什么?这将显示返回的完整标题。我在结果中看到Expires:Sat,2012年9月8日21:14:09 GMT。那只是因为YSlow很奇怪吗?如果可以

我的应用程序控制器中的before_过滤器中有以下内容:

def response_headers
  response.headers["Expires"] = CGI.rfc1123_date(Time.now + 1.year)
end

但是根据YSlow的说法,仍然没有设置任何expire头。有什么想法吗?

如果您使用
curl-I
检查会发生什么?这将显示返回的完整标题。我在结果中看到Expires:Sat,2012年9月8日21:14:09 GMT。那只是因为YSlow很奇怪吗?如果可以的话,也许可以粘贴完整的标题。可能存在某种缓存忽略指令。