(self, request, cacheable_methods=None, **kw)
return resp
Send a request. Use the request information to see if it
        exists in the cache and cache the response if we need to and can.
Send a request. Use the request information to see if it
        exists in the cache and cache the response if we need to and can.
Send a request . Use the request information to see if it exists in the cache and cache the response if we need to and can .
def send(self, request, cacheable_methods=None, **kw):
        """
        Send a request. Use the request information to see if it
        exists in the cache and cache the response if we need to and can.
        """
        cacheable = cacheable_methods or self.cacheable_methods
        if request.method in cacheable:
            try:
                cached_response = self.controller.cached_request(request)
            except zlib.error:
                cached_response = None
            if cached_response:
                return self.build_response(request, cached_response, from_cache=True)

            # check for etags and add headers if appropriate
            request.headers.update(self.controller.conditional_headers(request))

        resp = super(CacheControlAdapter, self).send(request, **kw)

        return resp
def send ( self , request , cacheable_methods = None , * * kw ) : cacheable = cacheable_methods or self . cacheable_methods if request . method in cacheable : try : cached_response = self . controller . cached_request ( request ) except zlib . error : cached_response = None if cached_response : return self . build_response ( request , cached_response , from_cache = True ) # check for etags and add headers if appropriate request . headers . update ( self . controller . conditional_headers ( request ) ) resp = super ( CacheControlAdapter , self ) . send ( request , * * kw ) return resp