new (options = nil)
public
Creates a new
cache. The options will be passed to any write method calls except
for :namespace which can be used to set the global namespace for
the cache.
Show source # File activesupport/lib/active_support/cache.rb, line 203
def initialize(options = nil)
@options = options ? normalize_options(options) : {}
@options[:compress] = true unless @options.key?(:compress)
@options[:compress_threshold] = DEFAULT_COMPRESS_LIMIT unless @options.key?(:compress_threshold)
@coder = @options.delete(:coder) { default_coder } || NullCoder
@coder_supports_compression = @coder.respond_to?(:dump_compressed)
end