public boolean isSuitableIfError(final RequestCacheControl requestCacheControl,
                                     final ResponseCacheControl responseCacheControl,
                                     final HttpCacheEntry entry,
                                     final Instant now) {
        // Explicit cache control
        if (requestCacheControl.getStaleIfError() > 0 || responseCacheControl.getStaleIfError() > 0) {
            final TimeValue currentAge = validityStrategy.getCurrentAge(entry, now);
            final TimeValue freshnessLifetime = validityStrategy.getFreshnessLifetime(responseCacheControl, entry);
            if (requestCacheControl.getMinFresh() > 0 && requestCacheControl.getMinFresh() < freshnessLifetime.toSeconds()) {
                return false;
            }
            final long stale = currentAge.compareTo(freshnessLifetime) > 0 ? currentAge.toSeconds() - freshnessLifetime.toSeconds() : 0;
            if (requestCacheControl.getStaleIfError() > 0 && stale < requestCacheControl.getStaleIfError()) {
                return true;
            }
            if (responseCacheControl.getStaleIfError() > 0 && stale < responseCacheControl.getStaleIfError()) {
                return true;
            }
        }
        // Global override
        if (staleifError && requestCacheControl.getStaleIfError() == -1 && responseCacheControl.getStaleIfError() == -1) {
            return true;
        }
        return false;
    }
Check entry against If-Modified-Since, if If-Modified-Since is in the future it is invalid
@param request The current httpRequest being made
@param entry the cache entry
@param now right NOW in time
@return  boolean Does the last modified header match
httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachedResponseSuitabilityChecker.java