feat: web server compression

Adds a compression middleware to the web server to reduce the request size when delivering static files. This speeds up loading times in web clients.

The chi middleware we're using for this currently supports `gzip` as compression algorithm. We might want to extend this to support `br` (Brotli) in the future, since it's a newer and more performant algorithm.
This commit is contained in:
Jannik Stehle
2024-05-31 12:34:12 +02:00
parent 62076ad976
commit 735ba7aebf
2 changed files with 7 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
Enhancement: Web server compression
We've added a compression middleware to the web server to reduce the request size when delivering static files. This speeds up loading times in web clients.
https://github.com/owncloud/ocis/pull/9287
https://github.com/owncloud/web/issues/7964

View File

@@ -99,6 +99,7 @@ func Server(opts ...Option) (http.Service, error) {
svc.Middleware(
chimiddleware.RealIP,
chimiddleware.RequestID,
chimiddleware.Compress(5),
middleware.NoCache,
webmid.SilentRefresh,
middleware.Version(