Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Adding support for response headers #422

@EyePulp

Description

@EyePulp

We use imaginary upstream from an nginx cache, and would like for nginx to receive the cache-control response header from the http sources that imaginary is pulling from. In our case S3 and Google Cloud Storage, where we can set the cache-control value when the image is stored there.

It appears currently that imaginary just returns the image buffer / body content from the http.Response, and doesn't pass through the response headers.

We don't want to use -http-cache-ttl as that doesn't accurately reflect the cache-control needs of the source images.

I'm working on a PR that works similarly to the -forward-headers argument, except for url response headers. The idea being that users can decide what headers if any they want passed back from a response, e.g.:

/bin/imaginary -enable-url-source -return-response-headers cache-control,etag

I'm new to Golang and may need some help, but I'll get a PR together. Please let me know if you have concerns or recommendations.

Thanks!

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