Module: FastlyRails::SurrogateControlHeaders
- Defined in:
- lib/fastly-rails/action_controller/surrogate_control_headers.rb
Instance Method Summary collapse
-
#set_surrogate_key_header(surrogate_key) ⇒ Object
Sets Surrogate-Control header Defaults are: Cache-Control: ‘public, no-cache, s-maxage: 30 days’ Surrogate-Control: ‘max-age: 30 days custom config example: ’blah, blah, blah’, surrogate_control: ‘max-age: blah’.
Instance Method Details
#set_surrogate_key_header(surrogate_key) ⇒ Object
Sets Surrogate-Control header Defaults are:
Cache-Control: 'public, no-cache, s-maxage: 30 days'
Surrogate-Control: 'max-age: 30 days
custom config example:
{cache_control: 'blah, blah, blah', surrogate_control: 'max-age: blah'}
9 10 11 12 |
# File 'lib/fastly-rails/action_controller/surrogate_control_headers.rb', line 9 def set_surrogate_key_header(surrogate_key) request.[:skip] = true # no cookies response.headers['Surrogate-Key'] = surrogate_key end |