The gzip handler should not gzip media content. This has no point since savings will be small for mp3 files and the like which are more or less compressed already as much as possible. Ideally it should detect content type here and make a decision based on some configuration. This have the following benefits:
Easier on the CPU for the server and client both. Considering mobile clients this could be a huge saving.
Will probably allow implementing io.ReaderFrom with io.Copy for non-gzipped files. This makes possible sending them with sendfile and friends.
The gzip handler should not gzip media content. This has no point since savings will be small for mp3 files and the like which are more or less compressed already as much as possible. Ideally it should detect content type here and make a decision based on some configuration. This have the following benefits:
io.ReaderFrom
withio.Copy
for non-gzipped files. This makes possible sending them withsendfile
and friends.