跳至内容 跳至搜索

空缓存存储

一种实际上不存储任何内容的缓存存储实现。在您不想启用缓存但需要通过缓存接口进行操作的开发和测试环境中很有用。

此缓存确实实现了本地缓存策略,因此值实际上将缓存在使用此策略的块中。有关更多详细信息,请参阅 ActiveSupport::Cache::Strategy::LocalCache

方法
C
D
I
S

类公共方法

supports_cache_versioning?()

宣传缓存版本控制支持。

# File activesupport/lib/active_support/cache/null_store.rb, line 18
def self.supports_cache_versioning?
  true
end

实例公共方法

cleanup(options = nil)

# File activesupport/lib/active_support/cache/null_store.rb, line 25
def cleanup(options = nil)
end

clear(options = nil)

# File activesupport/lib/active_support/cache/null_store.rb, line 22
def clear(options = nil)
end

decrement(name, amount = 1, options = nil)

# File activesupport/lib/active_support/cache/null_store.rb, line 31
def decrement(name, amount = 1, options = nil)
end

delete_matched(matcher, options = nil)

# File activesupport/lib/active_support/cache/null_store.rb, line 34
def delete_matched(matcher, options = nil)
end

increment(name, amount = 1, options = nil)

# File activesupport/lib/active_support/cache/null_store.rb, line 28
def increment(name, amount = 1, options = nil)
end