public HttpCacheEntry createUpdated(
            final Instant requestInstant,
            final Instant responseInstant,
            final HttpHost host,
            final HttpRequest request,
            final HttpResponse response,
            final HttpCacheEntry entry) {
        Args.notNull(requestInstant, "Request instant");
        Args.notNull(responseInstant, "Response instant");
        Args.notNull(response, "Origin response");
        Args.check(response.getCode() == HttpStatus.SC_NOT_MODIFIED,
                "Response must have 304 status code");
        Args.notNull(entry, "Cache entry");
        if (HttpCacheEntry.isNewer(entry, response)) {
            return entry;
        }
        final String s = CacheKeyGenerator.getRequestUri(host, request);
        final URI uri = CacheKeyGenerator.normalize(s);
        final HeaderGroup requestHeaders = filterHopByHopHeaders(request);
        // Strip AUTHORIZATION from request headers
        requestHeaders.removeHeaders(HttpHeaders.AUTHORIZATION);
        final HeaderGroup mergedHeaders = mergeHeaders(entry, response);
        return new HttpCacheEntry(
                requestInstant,
                responseInstant,
                request.getMethod(),
                uri.toASCIIString(),
                requestHeaders,
                entry.getStatus(),
                mergedHeaders,
                entry.getResource(),
                null);
    }
Creates updated entry with the new information from the response. Should only be used for
304 responses.

@param requestInstant   Date/time when the request was made (Used for age calculations)
@param responseInstant  Date/time that the response came back (Used for age calculations)
@param host             Target host
@param request          Original client request (a deep copy of this object is made)
@param response         Origin response (a deep copy of this object is made)
@param entry            Existing cache entry.
httpclient5-cache/src/main/java/org/apache/hc/client5/http/cache/HttpCacheEntryFactory.java