Skip to content

Commit f820696

Browse files
authored
docs: describe how to compress adapter-node responses (#11957)
1 parent 6cc860e commit f820696

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

documentation/docs/25-build-and-deploy/40-adapter-node.md

+6
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ node build
3232

3333
Development dependencies will be bundled into your app using [Rollup](https://rollupjs.org). To control whether a given package is bundled or externalised, place it in `devDependencies` or `dependencies` respectively in your `package.json`.
3434

35+
### Compressing responses
36+
37+
You will typically want to compress responses coming from the server. If you are already deploying your server behind a reverse proxy for SSL or load balancing, it typically results in better performance to also handle compression at that layer since Node.js is single-threaded.
38+
39+
However, if you're building a [#custom-server](custom server) and do want to add a compression middleware there, note that we would recommend using [`@polka/compression`](https://www.npmjs.com/package/@polka/compression) since SvelteKit streams responses and the more popular `compression` package does not support streaming and may cause errors when used.
40+
3541
## Environment variables
3642

3743
In `dev` and `preview`, SvelteKit will read environment variables from your `.env` file (or `.env.local`, or `.env.[mode]`, [as determined by Vite](https://vitejs.dev/guide/env-and-mode.html#env-files).)

0 commit comments

Comments
 (0)