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
-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