What is the use of enabling gzip in the front end of vue?

  1. when gzip, is enabled in the backend, the corresponding files will be compressed and recognized by the browser, which will have the effect of optimization.
  2. so the question is, what"s the use of enabling productionGzip: true, on the front end of a vue project?

clipboard.png

Aug.12,2021

for example, when nginx returns the js file to you, it will determine whether to open gzip, and then compress it and return it to the browser. But nginx actually determines whether there is the same file with the .gz suffix, and if so, it will return directly, and nginx itself will no longer compress it.

and compression takes time! Different levels of compression take different times.

so preparing the gz file in advance can be more optimized. And you can increase the compression ratio so that the bandwidth consumption will be less

.
Menu