[core] finish must-revalidate support
This commit is contained in:
@@ -140,7 +140,17 @@ public:
|
||||
revalidation.priorModified = offlineResponse->modified;
|
||||
revalidation.priorExpires = offlineResponse->expires;
|
||||
revalidation.priorEtag = offlineResponse->etag;
|
||||
callback(*offlineResponse);
|
||||
|
||||
// Don't return resources the server requested not to show when they're stale.
|
||||
// Even if we can't directly use the response, we may still use it to send a
|
||||
// conditional HTTP request.
|
||||
if (offlineResponse->isUsable()) {
|
||||
callback(*offlineResponse);
|
||||
} else {
|
||||
// Since we can't return the data immediately, we'll have to hold on so that
|
||||
// we can return it later in case we get a 304 Not Modified response.
|
||||
revalidation.priorData = offlineResponse->data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user