public void updateOnResponse(final HttpHost host,
                                 final String pathPrefix,
                                 final AuthExchange authExchange,
                                 final HttpContext context) {
        if (authExchange.getState() == AuthExchange.State.FAILURE) {
            clearCache(host, pathPrefix, HttpClientContext.cast(context));
        }
    }
Utility class that implements commons aspects of the client side authentication cache keeping.

@since 5.2
httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/AuthCacheKeeper.java