Update isStale method in HttpResponse to return true when max-age equals 0
Review Request #4877 - Created April 25, 2012 and submitted
Since max-age=0 means the response expires immediately when the response is generated, and there is no need to compute TTL with possibly incorrect server time. We can update the isStale method in HttpResponse to return true if max-age equals 0 instead of relying on computed TTL.
Posted (April 26, 2012, 2:56 p.m.)
As noted in the JIRA, the issue with the no-cache being returned on the first request, and the (incorrect) cached response on the second request occurs due to the modification of the cached response in the AbstractHttpCache.addResponse. This code slams the request's refresh interval onto the cache-control headers, and puts that into the cache, while the original request with no-cache is returned to the user. It seems like this fix would address only one specific issue, that of an incoming request with refresh interval = 0. If the refresh interval specified by the client is sufficiently smaller than the time skew between the two servers, wouldn't the same issue occur ?