From 6bb9cce1ed2f27dca783a45b294ea6df4baf0504 Mon Sep 17 00:00:00 2001 From: FHU-yezi Date: Fri, 18 Oct 2024 19:42:38 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=B8=8A=E6=B8=B8=20Bun=20=E6=A0=87?= =?UTF-8?q?=E5=87=86=E5=BA=93=E9=97=AE=E9=A2=98=E5=B7=B2=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=EF=BC=8C=E9=87=8D=E6=96=B0=E5=90=AF=E7=94=A8=20Brotli=20?= =?UTF-8?q?=E5=8E=8B=E7=BC=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Caddyfile | 3 +-- frontend/vite.config.ts | 9 ++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Caddyfile b/Caddyfile index b277ebc..fe55ec3 100644 --- a/Caddyfile +++ b/Caddyfile @@ -12,8 +12,7 @@ try_files {path} /index.html file_server { - # TODO: 由于 Bun 标准库实现问题,暂时禁用 Brotli 压缩 - precompressed gzip + precompressed br gzip } } diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index c6b098d..a91a0a9 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -56,11 +56,10 @@ export default defineConfig({ }, }), compression({ algorithm: "gzip" }), - // TODO: 由于 Bun 标准库实现问题,暂时禁用 Brotli 压缩 - // compression({ - // algorithm: "brotliCompress", - // ext: ".br", - // }), + compression({ + algorithm: "brotliCompress", + ext: ".br", + }), ], server: { proxy: {