in order to improve lighthouse score I need to enable gzip
and/or brotli
compression so it will increase performance score. I added two webpack plugins to my nuxt.config.js
file:
plugins: [
new CompressionPlugin({
filename: `[path].gz[query]`,
algorithm: `gzip`,
test: /\.js$|\.css$|\.html$/,
threshold: 10240,
minRatio: 0.8
}),
new BrotliPlugin({
asset: `[path].br[query]`,
test: /\.js$|\.css$|\.html$/,
threshold: 10240,
minRatio: 0.8
})
]
And I can confirm, that adding these two plugins is actually creating .gz
and .br
versions of my files.
Main questions is: should I do something additionaly with my nuxt config file in order to send these compressed files or nuxt will handle this by itself? Can it be checked on localhost
(because I've read that brotli
, for example, is only for HTTPS protocol)?
P.S. I don't use any framework like express
or restify