def METHOD_NAME(self, request: Request, spider: Spider) -> Optional[Response]:
    if request.meta.get("dont_cache", False):
        return None
    # Skip uncacheable requests
    if not self.policy.should_cache_request(request):
        request.meta["_dont_cache"] = True  # flag as uncacheable
        return None
    # Look for cached response and check if expired
    cachedresponse = self.storage.retrieve_response(spider, request)
    if cachedresponse is None:
        self.stats.inc_value("httpcache/miss", spider=spider)
        if self.ignore_missing:
            self.stats.inc_value("httpcache/ignore", spider=spider)
            raise IgnoreRequest(f"Ignored request not in cache: {request}")
        return None  # first time request
    # Return cached response only if not expired
    cachedresponse.flags.append("cached")
    if self.policy.is_cached_response_fresh(cachedresponse, request):
        self.stats.inc_value("httpcache/hit", spider=spider)
        return cachedresponse
    # Keep a reference to cached response to avoid a second cache lookup on
    # process_response hook
    request.meta["cached_response"] = cachedresponse
    return None