Skip to content

Commit

Permalink
feat: 禁用前端资源 Brotli 压缩
Browse files Browse the repository at this point in the history
  • Loading branch information
FHU-yezi committed May 2, 2024
1 parent e65e467 commit cea883e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
1 change: 1 addition & 0 deletions Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

try_files {path} /index.html
file_server {
# TODO: 由于 Bun 标准库实现问题,暂时禁用 Brotli 压缩
precompressed gzip
}
}
Expand Down
14 changes: 6 additions & 8 deletions frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,12 @@ export default defineConfig({
navigateFallbackDenylist: [/^\/api.*/],
},
}),
// GZip
compression({ threshold: 4096 }),
// Brotli
compression({
algorithm: "brotliCompress",
threshold: 4096,
ext: ".br",
}),
compression({ algorithm: "gzip" }),
// TODO: 由于 Bun 标准库实现问题,暂时禁用 Brotli 压缩
// compression({
// algorithm: "brotliCompress",
// ext: ".br",
// }),
],
server: {
proxy: {
Expand Down

0 comments on commit cea883e

Please sign in to comment.