mirror of
https://github.com/mjl-/mox.git
synced 2025-07-10 07:54:40 +03:00
implement transparent gzip compression in the webserver
we only compress if applicable (content-type indicates likely compressible), client supports it, response doesn't already have a content-encoding). for internal handlers, we always enable compression. for reverse proxied and static files, compression must be enabled per handler. for internal & reverse proxy handlers, we do streaming compression at "bestspeed" quality (probably level 1). for static files, we have a cache based on mtime with fixed max size, where we evict based on least recently used. we compress with the default level (more cpu, better ratio).
This commit is contained in:
@ -910,6 +910,13 @@ describe-static" and "mox config describe-domains":
|
||||
# (optional)
|
||||
DontRedirectPlainHTTP: false
|
||||
|
||||
# Transparently compress responses (currently with gzip) if the client supports
|
||||
# it, the status is 200 OK, no Content-Encoding is set on the response yet and the
|
||||
# Content-Type of the response hints that the data is compressible (text/...,
|
||||
# specific application/... and .../...+json and .../...+xml). For static files
|
||||
# only, a cache with compressed files is kept. (optional)
|
||||
Compress: false
|
||||
|
||||
# Serve static files. (optional)
|
||||
WebStatic:
|
||||
|
||||
|
Reference in New Issue
Block a user