Sha256: 3b9d96c385ebc96dc365db980dec9c7462e0f7af332f6c4c40ff2f2c80bf37b2

Contents?: true

Size: 503 Bytes

Versions: 4

Compression:

Stored size: 503 Bytes

Contents

module FastlyRails
  module SurrogateControlHeaders
    # 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'}
    def set_surrogate_key_header(surrogate_key)
      request.session_options[:skip] = true    # no cookies
      response.headers['Surrogate-Key'] = surrogate_key
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fastly-rails-0.1.4 lib/fastly-rails/action_controller/surrogate_control_headers.rb
fastly-rails-0.1.3 lib/fastly-rails/action_controller/surrogate_control_headers.rb
fastly-rails-0.1.2 lib/fastly-rails/action_controller/surrogate_control_headers.rb
fastly-rails-0.1.1 lib/fastly-rails/action_controller/surrogate_control_headers.rb