mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 08:15:31 +00:00
Bug 1611651 - Add pref for stale-while-revalidate r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D65813 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
fd2cf8c108
commit
340feb823a
@ -7366,6 +7366,11 @@
|
||||
value: true
|
||||
mirror: always
|
||||
|
||||
- name: network.http.stale_while_revalidate.enabled
|
||||
type: RelaxedAtomicBool
|
||||
value: true
|
||||
mirror: always
|
||||
|
||||
# Single TRR request timeout, in milliseconds
|
||||
- name: network.trr.request_timeout_ms
|
||||
type: RelaxedAtomicUint32
|
||||
|
@ -423,7 +423,8 @@ bool ValidationRequired(bool isForcedValid,
|
||||
LOG((" not validating, expire time not in the past"));
|
||||
} else if (cachedResponseHead->MustValidateIfExpired()) {
|
||||
doValidation = true;
|
||||
} else if (cachedResponseHead->StaleWhileRevalidate(now, expiration)) {
|
||||
} else if (cachedResponseHead->StaleWhileRevalidate(now, expiration) &&
|
||||
StaticPrefs::network_http_stale_while_revalidate_enabled()) {
|
||||
LOG((" not validating, in the stall-while-revalidate window"));
|
||||
doValidation = false;
|
||||
if (performBackgroundRevalidation) {
|
||||
|
@ -10569,6 +10569,10 @@ NS_IMPL_ISUPPORTS(BackgroundRevalidatingListener, nsIStreamListener,
|
||||
} // namespace
|
||||
|
||||
void nsHttpChannel::PerformBackgroundCacheRevalidation() {
|
||||
if (!StaticPrefs::network_http_stale_while_revalidate_enabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
LOG(("nsHttpChannel::PerformBackgroundCacheRevalidation %p", this));
|
||||
|
||||
Unused << NS_DispatchToMainThreadQueue(
|
||||
|
Loading…
Reference in New Issue
Block a user