8000 Gzip Support and cache-control headers · Issue #12 · aofei/air · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on May 17, 2025. It is now read-only.
This repository was archived by the owner on May 17, 2025. It is now read-only.
Gzip Support and cache-control headers #12
Open
@SaulDoesCode

Description

@SaulDoesCode

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0