Mention TLS record sizes & MIME sniffing (#1882)

Smaller record sizes can have massive TTFB improvements for clients, and `X-CTO: nosniff` is something sites should really be doing anyway for security reasons.
This commit is contained in:
Taylor Hunt 2023-02-10 20:05:33 -05:00 committed by GitHub
parent f1efd707aa
commit a8bf4df09d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,10 +10,16 @@
- Some software doesnt support HTTP/2 or higher “upstream” connections at all or very well — if your Node server uses HTTP/2, you may need to downgrade.
- Automatic gzip/brotli compression may have their buffer sizes set too high; you can tune their buffers to be smaller for faster streaming in exchange for slightly worse compression.
- Check if “upstream” connections are `keep-alive`: overhead from closing and reopening connections may delay responses.
- For typical modern webpage filesizes, the following bullet points probably wont matter. But if you want to stream **small chunks of data with the lowest latency**, investigate these sources of buffering:
- Automatic gzip/brotli compression may have their buffer sizes set too high; you can tune their buffers to be smaller for faster streaming in exchange for slightly worse compression.
- You can [tune HTTPS record sizes for lower latency, as described in High Performance Browser Networking](https://hpbn.co/transport-layer-security-tls/#optimize-tls-record-size).
- Turning off MIME sniffing with [the `X-Content-Type-Options`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options) header eliminates browser buffering at the very beginning of HTTP responses
### NGiNX
Most of NGiNXs relevant parameters are inside [its builtin `http_proxy` module](https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffering):