long getExpirationDurationInSeconds(HttpHeaders httpHeaders) {
    long expirationDurationInSeconds = 0;
    if (httpHeaders.getCacheControl() != null) {
      for (String arg : httpHeaders.getCacheControl().split(",")) {
        Matcher m = MAX_AGE_PATTERN.matcher(arg);
        if (m.matches()) {
          expirationDurationInSeconds = Long.valueOf(m.group(1));
          break;
        }
      }
    }
    if (httpHeaders.getAge() != null) {
      expirationDurationInSeconds -= httpHeaders.getAge();
    }
    return Math.max(0, expirationDurationInSeconds);
  }
Gets the cache TimeInMillis in seconds. "max-age" in "Cache-Control" header and "Age" header
are considered.

@param httpHeaders the http header of the response
@return the cache TimeInMillis in seconds or zero if the response should not be cached
java_src/src/main/java/com/google/crypto/tink/util/KeysDownloader.java