-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
建议官网展示的前端项目nginx部署的时候加上gzip压缩,加速第一次访问 #88
Comments
3q |
如何实现按需加载对应的文件 目前是一次性全部加载 |
@ileadall42 你好,我用的是 caddy,也加了 gzip 相关的配置,第一次访问速度还是在 5 到 6 秒才能打开页面,去琢磨了下代码里面,优化空间确实不大了,这个速度算正常吗,咨询下你那边是多长时间,还有别的优化建议吗 |
办法是有,在 vue.config.js 里面加上压缩的代码,在 nginx.conf 里面加上 gzip,我自己弄了,需要参考代码不 |
配置发一下,参考一下吧 |
@jlsunl 项目整体需要把 ant-design-vue 改成按需加载 nginx.conf 的 http 中加入以下片断
vue.config.js
|
请问相关require文件能发一下吗谢谢 |
@shuperry 谢谢 |
plugins/theme.plugin? 在哪里 谢谢 |
大佬 env.config 也发下啊 |
@wyyina plugins/theme.plugin.js
env.config.js
package.json -> scripts
|
我也开启了GZIP,原来6M,后来2M,但是首次加载30秒??? |
第一次就是慢点,等vue3出来,会显著改善 |
vue3也没快多少 |
是的,没有感觉到vue3快过 |
部署之后比vue2现住快很多,开发环境的确不如vue2 |
nginx.conf 的 http 中加入 # gzip config片断
具体参数:
参考:在部署的时候开启nginx的gzip自己调节参数,以及history的try_files解决方案和相关https安全部署方案。
The text was updated successfully, but these errors were encountered: