mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2024-11-27 20:03:45 +03:00
Disable caching
This commit is contained in:
parent
ed3997272e
commit
ba19010545
|
@ -145,7 +145,6 @@
|
|||
|
||||
httpLib.ifModifiedSince(pacUrl, lastModifiedStr, (err, newLastModifiedStr) => {
|
||||
|
||||
if (!newLastModifiedStr) {
|
||||
/*
|
||||
TODO: Get rid of this dirty hack
|
||||
IPFS used by AntiZapret always returns last-modified date as new Date(1000) which is 1 sec since unix epoch.
|
||||
|
@ -153,9 +152,11 @@
|
|||
Hack here is to consider 5 seconds since epoch time the same way as the unix epoch start.
|
||||
If you think etags are the solution then know that etags can't be read from the fetch API, see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Expose-Headers.
|
||||
*/
|
||||
const ifWasEverModified = new Date(lastModifiedStr) - new Date(0) > 5000;
|
||||
if (ifWasEverModified) {
|
||||
/*
|
||||
TODO: I turn off caching for now because I see no easy way out.
|
||||
|
||||
const ifWasEverModified = new Date(lastModifiedStr) - new Date(0) > 5000;
|
||||
if (!newLastModifiedStr && ifWasEverModified) {
|
||||
addWarning(
|
||||
(ifRu
|
||||
? 'Ваш PAC-скрипт не нуждается в обновлении. Его дата: '
|
||||
|
@ -165,7 +166,7 @@
|
|||
const res = {lastModified: lastModifiedStr};
|
||||
return cb(null, res);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// Employ all urls, the latter are fallbacks for the former.
|
||||
const pacDataPromise = provider.pacUrls.reduce(
|
||||
|
|
Loading…
Reference in New Issue
Block a user