Class: ActiveSupport::Cache::NullStore
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
Store
|
|
|
Instance Chain:
self,
Strategy::LocalCache,
Store
|
|
| Inherits: |
ActiveSupport::Cache::Store
|
| Defined in: | activesupport/lib/active_support/cache/null_store.rb |
Overview
Null Cache Store
A cache store implementation which doesn't actually store anything. Useful in development and test environments where you don't want caching turned on but need to go through the caching interface.
This cache does implement the local cache strategy, so values will actually
be cached inside blocks that utilize this strategy. See
Strategy::LocalCache for more details.
Constant Summary
Store - Inherited
Class Attribute Summary
-
.supports_cache_versioning? ⇒ Boolean
readonly
Advertise cache versioning support.
Store - Inherited
Class Method Summary
Store - Inherited
| .new | Creates a new cache. |
| .retrieve_pool_options | |
Instance Attribute Summary
Strategy::LocalCache - Included
Store - Inherited
| #logger, | |
| #namespace | Get the current namespace. |
| #namespace= | Set the current namespace. |
| #options, #raise_on_invalid_cache_expiration_time, | |
| #silence? | Alias for Store#silence. |
Instance Method Summary
- #cleanup(options = nil)
- #clear(options = nil)
- #decrement(name, amount = 1, **options)
- #delete_matched(matcher, options = nil)
- #increment(name, amount = 1, **options)
- #delete_entry(key, **options) private
- #instance_variables_to_inspect private
- #read_entry(key, **s) private
- #read_serialized_entry(_key) private
- #write_entry(key, entry) private
- #write_serialized_entry(_key, _payload) private
Strategy::LocalCache - Included
| #initialize, | |
| #local_cache | The current local cache. |
| #middleware | Middleware class can be inserted as a |
| #new_local_cache | Set a new local cache. |
| #unset_local_cache | Unset the current local cache. |
| #with_local_cache | Use a local cache for the duration of block. |
| #delete_entry, #read_multi_entries, #read_multi_entries_from_local_cache, #read_serialized_entry, #use_temporary_local_cache, #write_cache_value, #write_serialized_entry, #cleanup, #clear, #decrement, #delete_matched, #fetch_multi, #increment | |
Store - Inherited
| #cleanup | Cleans up the cache by removing expired entries. |
| #clear | Clears the entire cache. |
| #decrement | Decrements an integer value in the cache. |
| #delete | Deletes an entry in the cache. |
| #delete_matched | Deletes all entries with keys matching the pattern. |
| #delete_multi | Deletes multiple entries in the cache. |
| #exist? | Returns |
| #fetch | Fetches data from the cache, using the given key. |
| #fetch_multi | Fetches data from the cache, using the given keys. |
| #increment | Increments an integer value in the cache. |
| #mute | Silences the logger within a block. |
| #read | Reads data from the cache, using the given key. |
| #read_counter | Reads a counter that was set by #increment / #decrement. |
| #read_multi | Reads multiple values at once from the cache. |
| #silence, | |
| #silence! | Silences the logger. |
| #write | Writes the value to the cache with the key. |
| #write_counter | Writes a counter that can then be modified by #increment / #decrement. |
| #write_multi |
|
| #default_serializer, | |
| #delete_entry | Deletes an entry from the cache implementation. |
| #delete_multi_entries | Deletes multiples entries in the cache implementation. |
| #deserialize_entry, #expand_and_namespace_key, | |
| #expanded_key | Expands key to be a consistent string value. |
| #expanded_version, #get_entry_value, #handle_expired_entry, #handle_invalid_expires_in, #instrument, #instrument_multi, | |
| #key_matcher | Adds the namespace defined in the options to a pattern designed to match keys. |
| #merged_options | Merges the default options with ones specific to a method call. |
| #namespace_key | Prefix the key with a namespace string: |
| #normalize_key | Expands, namespaces and truncates the cache key. |
| #normalize_options | Normalize aliased options to their canonical form. |
| #normalize_version, | |
| #read_entry | Reads an entry from the cache implementation. |
| #read_multi_entries | Reads multiple entries from the cache implementation. |
| #save_block_result_to_cache, #serialize_entry, #truncate_key, #validate_options, | |
| #write_entry | Writes an entry to the cache implementation. |
| #write_multi_entries | Writes multiple entries to the cache implementation. |
| #new_entry | |
Constructor Details
This class inherits a constructor from ActiveSupport::Cache::Store
Class Attribute Details
.supports_cache_versioning? ⇒ Boolean (readonly)
Advertise cache versioning support.
# File 'activesupport/lib/active_support/cache/null_store.rb', line 22
def self.supports_cache_versioning? true end
Instance Method Details
#cleanup(options = nil)
[ GitHub ]# File 'activesupport/lib/active_support/cache/null_store.rb', line 29
def cleanup( = nil) end
#clear(options = nil)
[ GitHub ]# File 'activesupport/lib/active_support/cache/null_store.rb', line 26
def clear( = nil) end
#decrement(name, amount = 1, **options)
[ GitHub ]# File 'activesupport/lib/active_support/cache/null_store.rb', line 35
def decrement(name, amount = 1, **) end
#delete_entry(key, **options) (private)
[ GitHub ]# File 'activesupport/lib/active_support/cache/null_store.rb', line 63
def delete_entry(key, **) false end
#delete_matched(matcher, options = nil)
[ GitHub ]# File 'activesupport/lib/active_support/cache/null_store.rb', line 38
def delete_matched(matcher, = nil) end
#increment(name, amount = 1, **options)
[ GitHub ]# File 'activesupport/lib/active_support/cache/null_store.rb', line 32
def increment(name, amount = 1, **) end
#instance_variables_to_inspect (private)
[ GitHub ]# File 'activesupport/lib/active_support/cache/null_store.rb', line 44
def instance_variables_to_inspect [:@options].freeze end
#read_entry(key, **s) (private)
[ GitHub ]# File 'activesupport/lib/active_support/cache/null_store.rb', line 48
def read_entry(key, **s) deserialize_entry(read_serialized_entry(key)) end
#read_serialized_entry(_key) (private)
[ GitHub ]# File 'activesupport/lib/active_support/cache/null_store.rb', line 52
def read_serialized_entry(_key, **) end
#write_entry(key, entry) (private)
[ GitHub ]# File 'activesupport/lib/active_support/cache/null_store.rb', line 55
def write_entry(key, entry, **) write_serialized_entry(key, serialize_entry(entry)) end
#write_serialized_entry(_key, _payload) (private)
[ GitHub ]# File 'activesupport/lib/active_support/cache/null_store.rb', line 59
def write_serialized_entry(_key, _payload, **) true end