Module: FastlyRails::SurrogateKeyHeaders

Defined in:
lib/fastly-rails/action_controller/surrogate_key_headers.rb

Instance Method Summary collapse

Instance Method Details

#set_surrogate_key_header(*surrogate_keys) ⇒ Object

Sets Surrogate-Key HTTP header with one or more keys strips session data from the request


6
7
8
9
# File 'lib/fastly-rails/action_controller/surrogate_key_headers.rb', line 6

def set_surrogate_key_header(*surrogate_keys)
  request.session_options[:skip] = true  # No Set-Cookie
  response.headers['Surrogate-Key'] = surrogate_keys.join(' ')
end