Commit beed65be authored by Lukáš Huvar's avatar Lukáš Huvar Committed by Tim Neutkens

Compression documentation (#8247)

* Documentation about gzip

* Update packages/next/README.md
Co-Authored-By: 's avatarTim Neutkens <tim@timneutkens.nl>

* Improve docs

* Update packages/next/README.md
Co-Authored-By: 's avatarLuis Fernando Alvarez D. <luis@zeit.co>

* Update packages/next/README.md
Co-Authored-By: 's avatarLuis Fernando Alvarez D. <luis@zeit.co>

* Update README.md
parent 9b02939c
...@@ -34,6 +34,8 @@ ...@@ -34,6 +34,8 @@
- [How to use](#how-to-use) - [How to use](#how-to-use)
- [Setup](#setup) - [Setup](#setup)
- [Quick Start](#quick-start)
- [Manual Setup](#manual-setup)
- [Automatic code splitting](#automatic-code-splitting) - [Automatic code splitting](#automatic-code-splitting)
- [CSS](#css) - [CSS](#css)
- [Built-in CSS support](#built-in-css-support) - [Built-in CSS support](#built-in-css-support)
...@@ -93,6 +95,7 @@ ...@@ -93,6 +95,7 @@
- [CDN support with Asset Prefix](#cdn-support-with-asset-prefix) - [CDN support with Asset Prefix](#cdn-support-with-asset-prefix)
- [Automatic Prerendering](#automatic-prerendering) - [Automatic Prerendering](#automatic-prerendering)
- [Production deployment](#production-deployment) - [Production deployment](#production-deployment)
- [Compression](#compression)
- [Serverless deployment](#serverless-deployment) - [Serverless deployment](#serverless-deployment)
- [One Level Lower](#one-level-lower) - [One Level Lower](#one-level-lower)
- [Summary](#summary) - [Summary](#summary)
...@@ -2142,6 +2145,18 @@ Note: `NODE_ENV` is properly configured by the `next` subcommands, if absent, to ...@@ -2142,6 +2145,18 @@ Note: `NODE_ENV` is properly configured by the `next` subcommands, if absent, to
Note: we recommend putting `.next`, or your [custom dist folder](https://github.com/zeit/next.js#custom-configuration), in `.gitignore` or `.npmignore`. Otherwise, use `files` or `now.files` to opt-into a whitelist of files you want to deploy, excluding `.next` or your custom dist folder. Note: we recommend putting `.next`, or your [custom dist folder](https://github.com/zeit/next.js#custom-configuration), in `.gitignore` or `.npmignore`. Otherwise, use `files` or `now.files` to opt-into a whitelist of files you want to deploy, excluding `.next` or your custom dist folder.
### Compression
Next.js provides [gzip](https://tools.ietf.org/html/rfc6713#section-3) compression to compress rendered content and static files. Compression only works with the `server` target. In general you will want to enable compression on a HTTP proxy like [nginx](https://www.nginx.com/), to offload load from the `Node.js` process.
To disable **compression** in Next.js, set `compression` to `false` in `next.config.js`:
```js
// next.config.js
module.exports = {
compression: false,
}
```
### Serverless deployment ### Serverless deployment
<details> <details>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment