1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-15 15:32:28 +02:00
Raymond Hill 2018-09-18 17:05:53 -04:00
parent a57450e1a0
commit 6544ff5c56
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -600,14 +600,17 @@ var onHeadersReceived = function(details) {
// https://bugzilla.mozilla.org/show_bug.cgi?id=1376932
// Prevent document from being cached by the browser if we modified it,
// either through HTML filtering and/or modified response headers.
// https://github.com/uBlockOrigin/uBlock-issues/issues/229
// Use `no-cache` instead of `no-cache, no-store, must-revalidate`, this
// allows Firefox's offline mode to work as expected.
if ( (filteredHTML || modifiedHeaders) && dontCacheResponseHeaders ) {
let i = headerIndexFromName('cache-control', responseHeaders);
if ( i !== -1 ) {
responseHeaders[i].value = 'no-cache, no-store, must-revalidate';
responseHeaders[i].value = 'no-cache';
} else {
responseHeaders[responseHeaders.length] = {
name: 'Cache-Control',
value: 'no-cache, no-store, must-revalidate'
value: 'no-cache'
};
}
modifiedHeaders = true;