When you run a Lighthouse performance test on a writefreely server, adding text compression is its top suggestion to improve performance.
Currently, even when the browser sends an Accept-Encoding: gzip
header the writefreely does not respond with gzipped content. That is because the http
package does not handle such content negotiation by default.
I suggest using GitHub - nytimes/gziphandler: Go middleware to gzip HTTP responses to add gzip support. As seen in the README on that GitHub page, it is very easy to add to the code by just adding a wrapper around an existing http.Handler
object.