Class: HTTP::Cache

Inherits:
Object
  • Object
show all
Defined in:
lib/http/cache.rb,
lib/http/cache/headers.rb,
lib/http/cache/null_cache.rb

Defined Under Namespace

Classes: Headers, NullCache, NullLogger

Instance Method Summary collapse

Instance Method Details

#perform(request, options) {|request, options| ... } ⇒ Response

request can be made

Yields:

Returns:

  • (Response)

    a cached response that is valid for the request or the result of executing the provided block



26
27
28
29
30
31
32
# File 'lib/http/cache.rb', line 26

def perform(request, options, &request_performer)
  req = request.caching

  invalidate_cache(req) if req.invalidates_cache?

  get_response(req, options, request_performer)
end