feat(pwa): add sw.js
This commit is contained in:
parent
42b2dba589
commit
f7111b5903
3 changed files with 86 additions and 3 deletions
|
|
@ -2,7 +2,6 @@ import progressbar from '../render/progressbar'
|
|||
import { noop } from '../util/core'
|
||||
|
||||
const cache = {}
|
||||
const RUN_VERSION = Date.now()
|
||||
|
||||
/**
|
||||
* Simple ajax get
|
||||
|
|
@ -16,8 +15,6 @@ export function get (url, hasBar = false) {
|
|||
xhr.addEventListener.apply(xhr, arguments)
|
||||
}
|
||||
|
||||
url += (/\?(\w+)=/g.test(url) ? '&' : '?') + `v=${RUN_VERSION}`
|
||||
|
||||
if (cache[url]) {
|
||||
return { then: cb => cb(cache[url]), abort: noop }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue