class ActiveSupport::Cache::FileStore
def write_serialized_entry(key, payload, **options)
def write_serialized_entry(key, payload, **options) return false if options[:unless_exist] && File.exist?(key) ensure_cache_path(File.dirname(key)) File.atomic_write(key, cache_path) { |f| f.write(payload) } true end