Namespace
Module
Methods
Class Public methods
new(store = Rails.cache)
📝 Source code
# File actionpack/lib/action_dispatch/http/rack_cache.rb, line 37
def initialize(store = Rails.cache)
@store = store
end
🔎 See on GitHub
resolve(uri)
📝 Source code
# File actionpack/lib/action_dispatch/http/rack_cache.rb, line 33
def self.resolve(uri)
new
end
🔎 See on GitHub
Instance Public methods
exist?(key)
📝 Source code
# File actionpack/lib/action_dispatch/http/rack_cache.rb, line 41
def exist?(key)
@store.exist?(key)
end
🔎 See on GitHub
open(key)
📝 Source code
# File actionpack/lib/action_dispatch/http/rack_cache.rb, line 45
def open(key)
@store.read(key)
end
🔎 See on GitHub
read(key)
📝 Source code
# File actionpack/lib/action_dispatch/http/rack_cache.rb, line 49
def read(key)
body = open(key)
body.join if body
end
🔎 See on GitHub
write(body)
📝 Source code
# File actionpack/lib/action_dispatch/http/rack_cache.rb, line 54
def write(body)
buf = []
key, size = slurp(body) { |part| buf << part }
@store.write(key, buf)
[key, size]
end
🔎 See on GitHub