Closed spidgorny closed 3 years ago
Hi @spidgorny ,
There is an official one since about 2 months, here: https://github.com/curveball/static
I hope it does what you need. If not, contributions are welcome!
Thank you. My version is less organized, but supports brotli compression. https://gist.github.com/spidgorny/0ee06844e17267a1c001e10e1bd307ac
@spidgorny i wonder, is brolti compression really something you'd wanna do on the fly for each request? My understanding is that it's really hard on CPU.
I think an official version of brotli compression would ideally be part of a caching middleware that not only compresses, but also stores the compressed objects for re-use as long as the cache is remains valid.
You are right. This is probably an overkill for a general purpose library. In my case though (high CPU, low bandwidth) this was exactly what I was looking for. I'd use your suggestion next time. This issue can be closed.
I could not find any static middleware (serving static files from a folder). I've made my own, will gladly share with everybody. What's the best way? Copy/paste here in the issue for the maintainer to have a look?