public final ResponseCacheControl parseResponse(final Iterator<Header> headerIterator) {
        Args.notNull(headerIterator, "headerIterator");
        final ResponseCacheControl.Builder builder = ResponseCacheControl.builder();
        parse(headerIterator, (name, value) -> {
            if (name.equalsIgnoreCase(HeaderConstants.CACHE_CONTROL_S_MAX_AGE)) {
                builder.setSharedMaxAge(parseSeconds(name, value));
            } else if (name.equalsIgnoreCase(HeaderConstants.CACHE_CONTROL_MAX_AGE)) {
                builder.setMaxAge(parseSeconds(name, value));
            } else if (name.equalsIgnoreCase(HeaderConstants.CACHE_CONTROL_MUST_REVALIDATE)) {
                builder.setMustRevalidate(true);
            } else if (name.equalsIgnoreCase(HeaderConstants.CACHE_CONTROL_NO_CACHE)) {
                builder.setNoCache(true);
                if (value != null) {
                    final Tokenizer.Cursor valCursor = new ParserCursor(0, value.length());
                    final Set<String> noCacheFields = new HashSet<>();
                    while (!valCursor.atEnd()) {
                        final String token = tokenParser.parseToken(value, valCursor, VALUE_DELIMS);
                        if (!TextUtils.isBlank(token)) {
                            noCacheFields.add(token);
                        }
                        if (!valCursor.atEnd()) {
                            valCursor.updatePos(valCursor.getPos() + 1);
                        }
                    }
                    builder.setNoCacheFields(noCacheFields);
                }
            } else if (name.equalsIgnoreCase(HeaderConstants.CACHE_CONTROL_NO_STORE)) {
                builder.setNoStore(true);
            } else if (name.equalsIgnoreCase(HeaderConstants.CACHE_CONTROL_PRIVATE)) {
                builder.setCachePrivate(true);
            } else if (name.equalsIgnoreCase(HeaderConstants.CACHE_CONTROL_PROXY_REVALIDATE)) {
                builder.setProxyRevalidate(true);
            } else if (name.equalsIgnoreCase(HeaderConstants.CACHE_CONTROL_PUBLIC)) {
                builder.setCachePublic(true);
            } else if (name.equalsIgnoreCase(HeaderConstants.CACHE_CONTROL_STALE_WHILE_REVALIDATE)) {
                builder.setStaleWhileRevalidate(parseSeconds(name, value));
            } else if (name.equalsIgnoreCase(HeaderConstants.CACHE_CONTROL_STALE_IF_ERROR)) {
                builder.setStaleIfError(parseSeconds(name, value));
            } else if (name.equalsIgnoreCase(HeaderConstants.CACHE_CONTROL_MUST_UNDERSTAND)) {
                builder.setMustUnderstand(true);
            } else if (name.equalsIgnoreCase(HeaderConstants.CACHE_CONTROL_IMMUTABLE)) {
                builder.setImmutable(true);
            }
        });
        return builder.build();
    }
Parses the specified response header and returns a new {@link ResponseCacheControl} instance containing
the relevant caching directives.

<p>The returned {@link ResponseCacheControl} instance will contain the values for "max-age" and "s-maxage"
caching directives parsed from the input header. If the input header does not contain any caching directives
or if the directives are malformed, the returned {@link ResponseCacheControl} instance will have default values
for "max-age" and "s-maxage" (-1).</p>

@param headerIterator the header to parse, cannot be {@code null}
@return a new {@link ResponseCacheControl} instance containing the relevant caching directives parsed
from the response header
@throws IllegalArgumentException if the input header is {@code null}
httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CacheControlHeaderParser.java