From e107cbb370942dbcb233c17b50745b64497bd7d2 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Fri, 21 Sep 2018 09:16:46 -0400 Subject: [PATCH] revised fix for https://github.com/uBlockOrigin/uBlock-issues/issues/229 --- src/js/background.js | 1 + src/js/traffic.js | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/js/background.js b/src/js/background.js index 05a0bd915..d49910cfa 100644 --- a/src/js/background.js +++ b/src/js/background.js @@ -44,6 +44,7 @@ var µBlock = (function() { // jshint ignore:line autoUpdatePeriod: 7, cacheStorageCompression: true, debugScriptlets: false, + cacheControlForFirefox1376932: 'no-cache, no-store, must-revalidate', ignoreRedirectFilters: false, ignoreScriptInjectFilters: false, manualUpdateAssetFetchPeriod: 500, diff --git a/src/js/traffic.js b/src/js/traffic.js index bc6229543..cde1eb189 100644 --- a/src/js/traffic.js +++ b/src/js/traffic.js @@ -605,12 +605,13 @@ var onHeadersReceived = function(details) { // allows Firefox's offline mode to work as expected. if ( (filteredHTML || modifiedHeaders) && dontCacheResponseHeaders ) { let i = headerIndexFromName('cache-control', responseHeaders); + let cacheControl = µb.hiddenSettings.cacheControlForFirefox1376932; if ( i !== -1 ) { - responseHeaders[i].value = 'no-cache'; + responseHeaders[i].value = cacheControl; } else { responseHeaders[responseHeaders.length] = { name: 'Cache-Control', - value: 'no-cache' + value: cacheControl }; } modifiedHeaders = true;