class Async::HTTP::Cache::General
def wrap(key, request, response)
def wrap(key, request, response) if request.head? and body = response.body unless body.empty? Console.logger.warn(self) {"HEAD request resulted in non-empty body!"} return response end end unless cacheable_request?(request) Console.logger.debug(self) {"Cannot cache request!"} return response end unless cacheable_response?(response) Console.logger.debug(self) {"Cannot cache response!"} return response end return Body.wrap(response) do |response, body| if proceed_with_response_cache?(response) key ||= self.key(request) Console.logger.debug(self, key: key) {"Updating miss!"} @store.insert(key, request, Response.new(response, body)) end end end