Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Sep 18, 2018
1 parent a57450e commit 6544ff5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/js/traffic.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6544ff5

Please sign in to comment.