fix: drop gzip support, improve performance. (#1854)

BREAKING CHANGE

Not gzipping the output more than doubles the throughput for a simple "do nothing" RPC function.

Postgrest's gzip support was surprisingly slow, lacked in configurability, was undocumented and untested.

It was possible to achieve this before by not sending `Accept-Encoding: gzip`, but that turned into a bit of an undocumented gotcha. Most browsers do send it and by default a proxy pass would forward this header. Better to not support gzip at all, further focusing on ensuring Postgrest is a minimal layer over Postgres.

Nginx, or whatever proxy, provides critical options such as min length, vary headers and so forth, and will likely have much better performance as well.
This commit is contained in:
Alexander Ljungberg
2021-05-30 17:33:44 -05:00
committed by GitHub
parent d99909c403
commit 88a481da8a
2 changed files with 2 additions and 2 deletions
+2 -1
View File
@@ -36,7 +36,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- #1560, Volatile RPC called with GET now returns 405 Method not Allowed instead of 500 - @wolfgangwalther
- #1604, Change the default logging level to `log-level=error`. Only requests with a status greater or equal than 500 will be logged. If you wish to go back to the previous behaviour and log all the requests, use `log-level=info` - @steve-chavez
- #1617, Dropped support for PostgreSQL 9.4 - @wolfgangwalther
- #1854, Dropped undocumented support for gzip compression (which was surprisingly slow and easily enabled by mistake). In some use-cases this makes Postgres up to 3x faster - @aljungberg
## [7.0.1] - 2020-05-18
### Fixed
-1
View File
@@ -116,7 +116,6 @@ pgrstFormat minStatus date req status responseSize =
pgrstMiddleware :: LogLevel -> Wai.Application -> Wai.Application
pgrstMiddleware logLevel =
logger
. Wai.gzip Wai.def
. Wai.cors corsPolicy
. Wai.staticPolicy (Wai.only [("favicon.ico", "static/favicon.ico")])
where