Problem
When the cache middleware is used with the compress middleware, cached responses need to be re-compressed on every request. This adds 30-60ms latency on my machine for compressing cached responses.
// responese are cached uncompressed, and are compressed on-the-fly on each request
app.Use(compress.New(), cache.New())
The code below does not work because cache middleware does not know how to cache compressed content nor does it cache response headers such as Content-Encoding
app.Use(cache.New(), compress.New())
Suggested Solution
It would be nice to have a better integration between the two middleware handlers so that cached responses are pre-compressed.
The cache middleware does not check for the content encoding header, I fixed this in https://github.com/gofiber/fiber/pull/1054
Expect a version tag today or tomorrow 馃憤
Most helpful comment
The cache middleware does not check for the content encoding header, I fixed this in https://github.com/gofiber/fiber/pull/1054
Expect a version tag today or tomorrow 馃憤