diff --git a/docs/getting-started/bun.md b/docs/getting-started/bun.md index e4efc8d2..9779395b 100644 --- a/docs/getting-started/bun.md +++ b/docs/getting-started/bun.md @@ -150,6 +150,19 @@ app.get( ) ``` +### `precompressed` + +The `precompressed` option checks if files with extensions like `.br` or `.gz` are available and serves them based on the `Accept-Encoding` header. It prioritizes Brotli, then Zstd, and Gzip. If none are available, it serves the original file. + +```ts +app.get( + '/static/*', + serveStatic({ + precompressed: true, + }) +) +``` + ## Testing You can use `bun:test` for testing on Bun. diff --git a/docs/getting-started/deno.md b/docs/getting-started/deno.md index a5cf602a..998ece9c 100644 --- a/docs/getting-started/deno.md +++ b/docs/getting-started/deno.md @@ -137,6 +137,19 @@ app.get( ) ``` +### `precompressed` + +The `precompressed` option checks if files with extensions like `.br` or `.gz` are available and serves them based on the `Accept-Encoding` header. It prioritizes Brotli, then Zstd, and Gzip. If none are available, it serves the original file. + +```ts +app.get( + '/static/*', + serveStatic({ + precompressed: true, + }) +) +``` + ## Deno Deploy Deno Deploy is an edge runtime platform for Deno.