Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

缓存更新问题 #2

Open
lishichao1002 opened this issue Dec 4, 2019 · 0 comments
Open

缓存更新问题 #2

lishichao1002 opened this issue Dec 4, 2019 · 0 comments

Comments

@lishichao1002
Copy link

pwa一直理解的不太对,demo验证的时候效果也不对,说下场景,帮忙解答一下疑惑。

版本一:

index.html
index.js
sw.js

版本二:

index.html
index.js
sw.js

步骤:
当版本一内容修改后即(版本二),在加载版本二时,sw由版本一控制,即fetch事件会被拦截,导致的问题是,当加载版本二的index.html和index.js时,加载不到最新的版本,fetch返回的永远是版本一的结果。
另外offline-plugin和angular的sw在fetch的时候都加了时间戳,是不是用来避免版本更新时加载到的永远是旧版本的内容?

请帮忙回答一下疑惑?
多谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant