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

Webpack- webpack 的gzip 和 nginx gzip的区别 #29

Open
PleaseStartYourPerformance opened this issue Apr 27, 2022 · 0 comments
Open

Comments

@PleaseStartYourPerformance
Copy link
Owner

问题:webpack打包时已经进行gzip压缩了,那为什么还要再次开启nginx的gzip压缩呢?

nginx分为实时gzip和静态gzip, 所谓实时gzip就是无论你的静态资源有没有压缩,我都给你使用gzip压缩一次,所谓静态gzip,就是当你请求某个静态资源时,我先找下该静态资源有没有对应的gz文件,如果有,那nginx就直接使用gz文件,而不再进行实时gzip压缩, 从而减少了nginx对cpu的使用,加快了响应速度. 不过要使用静态gzip必须要先启用nginx的gzip_static 模块.

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