(!info.isHttpsProtocol() || ccPublic) && cacheHeaderFound &&
(vary == null || vary.length() == 0);
// compute freshness lifetime
// see http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.2.4
final Period lifetime;
if (pragmaNoCache || ccNoCache || !cacheable) {
lifetime = Period.ZERO;
}
// Cache-Control/s-maxage overwrites both Cache-Control/max-age
// and Expires
else if (ccSMaxAge != null) {
lifetime = ccSMaxAge;
// Cache-Control/max-age overwrites Expires
} else if (ccMaxAge != null) {
lifetime = ccMaxAge;
} else if (expires != null && info.getDate() != null) {
lifetime = expires.getPeriodSince(info.getDate());
// if freshness lifetime cannot be computed, return 0
} else {
lifetime = Period.ZERO;
}
freshnessLifetime = Period.max(Period.ZERO, lifetime);
// compute corrected initial age
// see http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.2.3
Period apparentAge = Period.ZERO;
if (info.getDate() != null) {
apparentAge = Period.max(Period.ZERO,
responseTime.getPeriodSince(info.getDate()));
}
Period correctedReceivedAge = apparentAge;
if (age != null) {
correctedReceivedAge = Period.max(apparentAge, age);
}
final Period responseDelay = Period.max(Period.ZERO,
responseTime.getPeriodSince(info.getRequestTime()));
correctedInitialAge = correctedReceivedAge.add(responseDelay);
}