private Duration extractMaxAge(Response response)
{
String header = response.getHeader(HttpHeaders.CACHE_CONTROL);
if (header != null) {
CacheControl cacheControl = CacheControl.valueOf(header);
if (cacheControl.getMaxAge() > 0) {
return new Duration(cacheControl.getMaxAge(), TimeUnit.SECONDS);
}
}
return DEFAULT_DELAY;
}