Module: Hanami::Action::Cache

Defined in:
lib/hanami/action/cache.rb,
lib/hanami/action/cache/expires.rb,
lib/hanami/action/cache/directives.rb,
lib/hanami/action/cache/cache_control.rb,
lib/hanami/action/cache/conditional_get.rb

Overview

Cache type API

See Also:

  • ClassMethods#cache_control
  • ClassMethods#expires
  • ClassMethods#fresh

Since:

  • 0.3.0

Defined Under Namespace

Modules: CacheControl, Expires Classes: ConditionalGet, Directives, ETag, LastModified, NonValueDirective, ValueDirective

Constant Summary collapse

VALUE_DIRECTIVES =

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.

Cache-Control directives which have values

Since:

  • 0.3.0

%i(max_age s_maxage min_fresh max_stale).freeze
NON_VALUE_DIRECTIVES =

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.

Cache-Control directives which are implicitly true

Since:

  • 0.3.0

%i(public private no_cache no_store no_transform must_revalidate proxy_revalidate).freeze
IF_NONE_MATCH =

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.

Since:

  • 0.3.0

'HTTP_IF_NONE_MATCH'.freeze
ETAG =

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 ETag

Since:

  • 0.3.0

'ETag'.freeze
IF_MODIFIED_SINCE =

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.

Since:

  • 0.3.0

'HTTP_IF_MODIFIED_SINCE'.freeze
LAST_MODIFIED =

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 Last-Modified

Since:

  • 0.3.0

'Last-Modified'.freeze

Class 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.

Override Ruby's hook for modules. It includes exposures logic

Parameters:

  • base (Class)

    the target action

See Also:

Since:

  • 0.3.0


24
25
26
27
28
# File 'lib/hanami/action/cache.rb', line 24

def self.included(base)
  base.class_eval do
    include CacheControl, Expires
  end
end