diff options
author | Xavier Noria <fxn@hashref.com> | 2012-02-17 05:16:58 -0800 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2012-02-17 05:18:37 -0800 |
commit | ce51edb73bce5e213568fd5a362fb3557a06aee1 (patch) | |
tree | 49491604277566acfc2a5af59adf679415c76da9 /actionpack/lib/action_controller/metal | |
parent | 4bb6ed7744c482dad6b71cffc19a0c86b730b730 (diff) | |
download | rails-ce51edb73bce5e213568fd5a362fb3557a06aee1.tar.gz rails-ce51edb73bce5e213568fd5a362fb3557a06aee1.tar.bz2 rails-ce51edb73bce5e213568fd5a362fb3557a06aee1.zip |
let expires_in accept a must_revalidate flag
Diffstat (limited to 'actionpack/lib/action_controller/metal')
-rw-r--r-- | actionpack/lib/action_controller/metal/conditional_get.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/metal/conditional_get.rb b/actionpack/lib/action_controller/metal/conditional_get.rb index 1645400693..41758d99e8 100644 --- a/actionpack/lib/action_controller/metal/conditional_get.rb +++ b/actionpack/lib/action_controller/metal/conditional_get.rb @@ -110,13 +110,17 @@ module ActionController # # Examples: # expires_in 20.minutes - # expires_in 3.hours, :public => true + # expires_in 3.hours, :public => true, :must_revalidate => true # expires_in 3.hours, 'max-stale' => 5.hours, :public => true # # This method will overwrite an existing Cache-Control header. # See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html for more possibilities. def expires_in(seconds, options = {}) #:doc: - response.cache_control.merge!(:max_age => seconds, :public => options.delete(:public)) + response.cache_control.merge!( + :max_age => seconds, + :public => options.delete(:public), + :must_revalidate => options.delete(:must_revalidate) + ) options.delete(:private) response.cache_control[:extras] = options.map {|k,v| "#{k}=#{v}"} |