class ActiveSupport::Cache::Store

def exist?(name, options = nil)

Options are passed to the underlying cache implementation.

Returns +true+ if the cache contains an entry for the given key.
def exist?(name, options = nil)
  options = merged_options(options)
  instrument(:exist?, name) do
    entry = read_entry(namespaced_key(name, options), options)
    (entry && !entry.expired?) || false
  end
end