You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 17, 2025. It is now read-only.
It would be very nice to see a golang web framework handle gzip natively and do it well. There are various libraries and middlewares out there which purport a well adjusted and performant solution to serving gzipped content.
I've made a fairly primitive project some time ago, which provides an echo instance with the ability to read, monitor, cache and recache various static assets either within a specified folder or definitively located elsewhere; with this it would determine an asset's compress-ability and compress it thusly, serving it, thereby, only when a client's Accept-Encoding header indicates gzip support.
Desireable Features In a Gzipping Sollution:
- Cache Gzipped Assets:
In memory, with coffer potentially.
watched assets, should, on changes, (asynchronously) re-compress/update a memory/disk backed asset.ext(.gz)
On Disk, like some nginx/apache configs permit.
eg. route localhost/asset.txt -> first looks for - > ./assets/.cache/asset.txt.gz
Client Side, by setting and maintaining the correct cache-control and etag headers.
- Compress at the highest level when caching, but automatically scale down with dynamic content.
Air does not seem to handle caching headers, (to my knowledge, I may be wrong), as all my coffer cached assets seem to be missing their cache-control headers. While it would be possible to deliberately add such caching headers, it would certainly also have been nice had the air sub systems managed cache headers when it detected that the higher level user has not set any or has not deliberately disabled cache-control.
It would be very nice to see a golang web framework handle gzip natively and do it well. There are various libraries and middlewares out there which purport a well adjusted and performant solution to serving gzipped content.
I've made a fairly primitive project some time ago, which provides an echo instance with the ability to read, monitor, cache and recache various static assets either within a specified folder or definitively located elsewhere; with this it would determine an asset's compress-ability and compress it thusly, serving it, thereby, only when a client's Accept-Encoding header indicates gzip support.
Desireable Features In a Gzipping Sollution:
- Cache Gzipped Assets:
cache-controlandetagheaders.- Compress at the highest level when caching, but automatically scale down with dynamic content.
Air does not seem to handle caching headers, (to my knowledge, I may be wrong), as all my coffer cached assets seem to be missing their
cache-controlheaders. While it would be possible to deliberately add such caching headers, it would certainly also have been nice had theairsub systems managed cache headers when it detected that the higher level user has not set any or has not deliberately disabledcache-control.