-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
Related issue: - uBlockOrigin/uBlock-issues#682 (comment) 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.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
gorhill
Author
Owner
|
||
const queryValue = `_=${cacheBypassToken}`; | ||
if ( actualUrl.indexOf('?') === -1 ) { | ||
actualUrl += '?'; | ||
} else { | ||
|
@gorhill, I think this should be "modulo prime", not
12
. If someone always turn on PC in "8am" there is a slight chance to hit cache.And if PC is turned off before
autoUpdatePeriod
this will be even worse.