Source: show | on GitHub
# File actionpack/lib/action_dispatch/http/rack_cache.rb, line 36 36: def initialize(store = RAILS_CACHE) 37: @store = store 38: end
# File actionpack/lib/action_dispatch/http/rack_cache.rb, line 32 32: def self.resolve(uri) 33: new 34: end
# File actionpack/lib/action_dispatch/http/rack_cache.rb, line 40 40: def exist?(key) 41: @store.exist?(key) 42: end
# File actionpack/lib/action_dispatch/http/rack_cache.rb, line 44 44: def open(key) 45: @store.read(key) 46: end
# File actionpack/lib/action_dispatch/http/rack_cache.rb, line 48 48: def read(key) 49: body = open(key) 50: body.join if body 51: end
# File actionpack/lib/action_dispatch/http/rack_cache.rb, line 53 53: def write(body) 54: buf = [] 55: key, size = slurp(body) { |part| buf << part } 56: @store.write(key, buf) 57: [key, size] 58: end