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

js 缓存问题 #200

Closed
kkfnui opened this issue Nov 15, 2017 · 6 comments
Closed

js 缓存问题 #200

kkfnui opened this issue Nov 15, 2017 · 6 comments
Assignees

Comments

@kkfnui
Copy link

kkfnui commented Nov 15, 2017

碰到一个问题,
打包后 引用的 index.js , js 文件更新后,很容易被中间的代理或者浏览器缓存,导致修改最终不能更新到用户。

是否可以将 index.js 、index.css 改成 index.js.{md5} 这样的命名呢?

@afc163
Copy link
Member

afc163 commented Nov 15, 2017

https://github.com/sorrycc/roadhog#hash

@afc163 afc163 closed this as completed Nov 15, 2017
@kkfnui
Copy link
Author

kkfnui commented Nov 15, 2017

多谢,现在 js 和 css 文件修改后文件名会修改了。

index.d912f4de.js
index.f8c84afa.css
index.html

但还是有个问题, index.html 引入的 文件名并未同步修改,是否有什么设置可以保持两者同步呢?

@kkfnui
Copy link
Author

kkfnui commented Nov 15, 2017

sorrycc/roadhog#386

找到之前的讨论了,看来还是个蛮常见的问题。
为什么默认不设置成hash 的呢?

@afc163 afc163 reopened this Nov 16, 2017
@afc163
Copy link
Member

afc163 commented Nov 16, 2017

确实应该默认设为 hash。

@Ycheck521
Copy link

打包完设置hash后 index。html引入的文件名如何同步呢

@afc163
Copy link
Member

afc163 commented Nov 22, 2017

Thx to @happier2 , we have hash entry now!

@afc163 afc163 closed this as completed Nov 22, 2017
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

4 participants