Module: Lotus::Action::Cache::CacheControl Private

Defined in:
lib/lotus/action/cache/cache_control.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Module with Cache-Control logic

Since:

  • 0.3.0

API:

  • private

Defined Under Namespace

Modules: ClassMethods Classes: Directives

Constant Summary collapse

HEADER =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

The HTTP header for Cache-Control

Since:

  • 0.3.0

API:

  • private

'Cache-Control'.freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.3.0

API:

  • private



19
20
21
# File 'lib/lotus/action/cache/cache_control.rb', line 19

def self.included(base)
  base.extend ClassMethods
end

Instance Method Details

#finishObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Finalize the response including default cache headers into the response

See Also:

  • Lotus::Action#finish

Since:

  • 0.3.0

API:

  • private



43
44
45
46
# File 'lib/lotus/action/cache/cache_control.rb', line 43

def finish
  super
  headers.merge!(self.class.cache_control_directives.headers) unless headers.include? HEADER
end