public boolean canBeServedFromCache(final RequestCacheControl cacheControl, final HttpRequest request) {
        final String method = request.getMethod();

        final ProtocolVersion pv = request.getVersion() != null ? request.getVersion() : HttpVersion.DEFAULT;
        if (HttpVersion.HTTP_1_1.compareToVersion(pv) != 0) {
            LOG.debug("non-HTTP/1.1 request cannot be served from cache");
            return false;
        }

        if (!Method.GET.isSame(method) && !Method.HEAD.isSame(method)) {
            if (LOG.isDebugEnabled()) {
                LOG.debug("{} request cannot be served from cache", method);
            }
            return false;
        }

        if (cacheControl.isNoStore()) {
            LOG.debug("Request with no-store cannot be served from cache");
            return false;
        }
        if (cacheControl.isNoCache()) {
            LOG.debug("Request with no-cache cannot be served from cache");
            return false;
        }
        LOG.debug("Request can be served from cache");
        return true;
    }
Determines if an HttpRequest can be served from the cache.

@param request
           an HttpRequest
@return boolean Is it possible to serve this request from cache
httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CacheableRequestPolicy.java