-
Notifications
You must be signed in to change notification settings - Fork 17
Description
When streaming an EPUB's content to web browsers using the go-toolkit, it is possible for the end user's device to be the only one that must perform decompression of the file's contents. This would result in a further decrease in CPU usage of any software using the go-toolkit, as decompression would not have to occur within the code, and additional reductions in resource usage may be avoided due to no longer needing to recompress the resource further up the chain, in e.g. nginx, apache etc.
How does this work in practice? Here's an example of the accept-encoding header of a modern browser (Chrome): Accept-Encoding: gzip, deflate, br, zstd
. The deflate
encoding is the same compression scheme used inside of ZIP files. This means that if you were to provide a browser that supports this encoding the contents of a compressed zip.File
using the OpenRaw()
method, and return content-encoding: deflate
, the browser would be able to decode it directly.