Does it also need to be configured to enable gzip, backend when vue is packaged?

config/index.js package after gzip compression is enabled:

clipboard.png
:

clipboard.png

clipboard.png

Mar.10,2021

The Accept-Encoding: gzip in

Request Headers simply indicates that the front end (user browser) supports gzip compression.

you also need to enable gzip support on the server. For more information, please see whether the Content-Encoding field in Response Headers is gzip.

and the server can support gzip in two ways:

  1. generate the corresponding .gz file when packaging. When the browser requests xx.js, the server returns the corresponding xxx.js.gz file
  2. when the browser requests xx.js, the server gzip compresses the xx.js and transmits it to the browser

to configure gzip, for backend servers, it is recommended to take a look at the complete gzip articles, such as https://zhuanlan.zhihu.com/p/24764131


when packing without gzip, browsers can be configured directly. Different browsers have different configuration methods.

Menu