Add support for "Cache-Control: max-stale" request header: https://tools.ietf.org/html/rfc7234#section-5.2.1.2
<rdar://problem/20333296>
Created attachment 249619 [details] Patch
We are now getting to really obscure corners of the spec. Are there any indications that anyone uses this?
Comment on attachment 249619 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=249619&action=review Well I suppose it is a potentially useful feature even if it is unknown. r=me but please consider factoring it differently. > Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp:168 > bool hasExpired = age > lifetime; > + if (hasExpired && !std::isnan(maxStale)) { > + // Request is allowing stale responses. > + // https://tools.ietf.org/html/rfc7234#section-5.2.1.2. > + if ((age - lifetime) < maxStale) > + hasExpired = false; > + } maxStale = std::isnan(maxStale) ? 0 : maxStale; bool hasExpired = age - lifetime > maxStale; > Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp:181 > +static bool requestRequiresRevalidation(const WebCore::ResourceRequest& request, double& maxStale) > { > auto requestDirectives = WebCore::parseCacheControlDirectives(request.httpHeaderFields()); > + maxStale = requestDirectives.maxStale; This is a bit strange way to factor this. We should probably combine requestRequiresRevalidation and responseHasExpired since you really need to be looking at both request and response to implement all semantics.
Created attachment 249732 [details] Patch
Comment on attachment 249732 [details] Patch Clearing flags on attachment: 249732 Committed r182145: <http://trac.webkit.org/changeset/182145>
All reviewed patches have been landed. Closing bug.