-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: web server compression #9287
Conversation
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.
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found this in the docs about Compress middleware:
NOTE: make sure to set the Content-Type header on your response otherwise this middleware will not compress the response body. For ex, in your handler you should set w.Header().Set("Content-Type", http.DetectContentType(yourBody)) or set it manually.
Are we doing this already?
Seems to be the case, although I can't tell where exactly this happens (I guess here ?). All responses have a |
exactly, all static assets use the assets server, so LGTM |
feat: web server compression
Description
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 supportbr
(Brotli) in the future, since it's a newer and more performant algorithm. But for now, any compression is a big step up.Related Issue
Types of changes