@Override
                        public void completed(final SimpleHttpResponse response) {
                            System.out.println(httpget3 + "->" + new StatusLine(response));
                            System.out.println("Cache status: " + context.getCacheResponseStatus());
                            System.out.println("Request cache control: " + context.getRequestCacheControlOrDefault());
                            System.out.println("Response cache control: " + context.getResponseCacheControlOrDefault());
                            final HttpCacheEntry cacheEntry = context.getCacheEntry();
                            if (cacheEntry != null) {
                                System.out.println("Cache entry resource: " + cacheEntry.getResource());
                                System.out.println("Date: " + cacheEntry.getInstant());
                                System.out.println("Expires: " + cacheEntry.getExpires());
                                System.out.println("Last modified: " + cacheEntry.getLastModified());
                            }
                        }
This is an example demonstrating how to control execution of cache
operation and determine its outcome using the async HTTP cache API.
httpclient5-cache/src/test/java/org/apache/hc/client5/http/cache/example/AsyncClientCacheControl.java