'Return a cached response if it exists in the cache, otherwise
return False.'

def cached_request(self, request):

    cache_url = self.cache_url(request.url)
    cc = self.parse_cache_control(request.headers)
    no_cache = (True if ('no-cache' in cc) else False)
    if (('max-age' in cc) and (cc['max-age'] == 0)):
        no_cache = True
    if no_cache:
        return False
    resp = self.serializer.loads(request, self.cache.get(cache_url))
    if (not resp):
        return False
    if (resp.status == 301):
        return resp
    headers = CaseInsensitiveDict(resp.headers)
    if ((not headers) or ('date' not in headers)):
        if ('etag' not in headers):
            self.cache.delete(cache_url)
        return False
    now = time.time()
    date = calendar.timegm(parsedate_tz(headers['date']))
    current_age = max(0, (now - date))
    resp_cc = self.parse_cache_control(headers)
    freshness_lifetime = 0
    if (('max-age' in resp_cc) and resp_cc['max-age'].isdigit()):
        freshness_lifetime = int(resp_cc['max-age'])
    elif ('expires' in headers):
        expires = parsedate_tz(headers['expires'])
        if (expires is not None):
            expire_time = (calendar.timegm(expires) - date)
            freshness_lifetime = max(0, expire_time)
    if ('max-age' in cc):
        try:
            freshness_lifetime = int(cc['max-age'])
        except ValueError:
            freshness_lifetime = 0
    if ('min-fresh' in cc):
        try:
            min_fresh = int(cc['min-fresh'])
        except ValueError:
            min_fresh = 0
        current_age += min_fresh
    fresh = (freshness_lifetime > current_age)
    if fresh:
        return resp
    if ('etag' not in headers):
        self.cache.delete(cache_url)
    return False
