mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 09:07:54 +01:00
Add ability to bypass browser cache when fetching a resource
Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/682#issuecomment-515197130 The following advanced setting has been added: updateAssetBypassBrowserCache Default to `false`. If set to `true`, uBO will ensure the browser cache is bypassed when fetching a remote resource. This is for the convenience of filter list maintainers who may want to test the latest version of their lists when fetched from their remote location.
This commit is contained in:
parent
8d136ec2d5
commit
048bfd251c
2 changed files with 10 additions and 1 deletions
|
@ -69,8 +69,16 @@ api.fetchText = function(url, onLoad, onError) {
|
|||
// https://github.com/gorhill/uBlock/issues/2592
|
||||
// Force browser cache to be bypassed, but only for resources which have
|
||||
// been fetched more than one hour ago.
|
||||
//
|
||||
// https://github.com/uBlockOrigin/uBlock-issues/issues/682#issuecomment-515197130
|
||||
// Provide filter list authors a way to completely bypass
|
||||
// the browser cache.
|
||||
if ( isExternal ) {
|
||||
const queryValue = `_=${Math.floor(Date.now() / 3600000) % 12}`;
|
||||
const cacheBypassToken =
|
||||
µBlock.hiddenSettings.updateAssetBypassBrowserCache
|
||||
? Math.floor(Date.now() / 1000) % 86400
|
||||
: Math.floor(Date.now() / 3600000) % 12;
|
||||
const queryValue = `_=${cacheBypassToken}`;
|
||||
if ( actualUrl.indexOf('?') === -1 ) {
|
||||
actualUrl += '?';
|
||||
} else {
|
||||
|
|
|
@ -58,6 +58,7 @@ const µBlock = (function() { // jshint ignore:line
|
|||
selfieAfter: 3,
|
||||
strictBlockingBypassDuration: 120,
|
||||
suspendTabsUntilReady: 'unset',
|
||||
updateAssetBypassBrowserCache: false,
|
||||
userResourcesLocation: 'unset',
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue