mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-19 00:29:35 +00:00
Only compress assets with a certain minimum size. Otherwise its quite inefficientg
This commit is contained in:
parent
0d4f935b43
commit
82e3e31277
1 changed files with 15 additions and 12 deletions
|
|
@ -169,22 +169,25 @@ for (const theme of AVAILABLE_THEMES) {
|
|||
|
||||
|
||||
if (Encore.isProduction()) {
|
||||
Encore.addPlugin(new CompressionPlugin({
|
||||
filename: '[path][base].br',
|
||||
algorithm: 'brotliCompress',
|
||||
test: /\.(js|css|html|svg)$/,
|
||||
compressionOptions: {
|
||||
// zlib’s `level` option matches Brotli’s `BROTLI_PARAM_QUALITY` option.
|
||||
level: 11,
|
||||
},
|
||||
//threshold: 10240,
|
||||
minRatio: 0.8,
|
||||
deleteOriginalAssets: false,
|
||||
}))
|
||||
Encore
|
||||
.addPlugin(new CompressionPlugin({
|
||||
filename: '[path][base].br',
|
||||
algorithm: 'brotliCompress',
|
||||
test: /\.(js|css|html|svg)$/,
|
||||
compressionOptions: {
|
||||
// zlib’s `level` option matches Brotli’s `BROTLI_PARAM_QUALITY` option.
|
||||
level: 11,
|
||||
},
|
||||
threshold: 10240,
|
||||
minRatio: 0.8,
|
||||
deleteOriginalAssets: false,
|
||||
}))
|
||||
|
||||
.addPlugin(new CompressionPlugin({
|
||||
filename: '[path][base].gz',
|
||||
algorithm: 'gzip',
|
||||
threshold: 10240,
|
||||
minRatio: 0.8,
|
||||
test: /\.(js|css|html|svg)$/,
|
||||
deleteOriginalAssets: false,
|
||||
}))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue