Refactor Cache-Control
and Vary
definitions (#24347)
This commit is contained in:
parent
4db8230194
commit
e98c86050a
64 changed files with 424 additions and 173 deletions
15
lib/action_controller/conditional_get_extensions.rb
Normal file
15
lib/action_controller/conditional_get_extensions.rb
Normal file
|
@ -0,0 +1,15 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ActionController
|
||||
module ConditionalGetExtensions
|
||||
def expires_in(*)
|
||||
# This backports a fix from Rails 7 so that a more private Cache-Control
|
||||
# can be overriden by calling expires_in on a specific controller action
|
||||
response.cache_control.delete(:no_store)
|
||||
|
||||
super
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ActionController::ConditionalGet.prepend(ActionController::ConditionalGetExtensions)
|
Loading…
Add table
Add a link
Reference in a new issue