Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

option to override remote image expire #208

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

medyagh
Copy link

@medyagh medyagh commented Dec 28, 2019

This PR:

Gives user the option to override the remote image hosting's expire date.

imageproxy -override-cache-control="public" -override-expires="Sat, 28 Dec 2199 04:09:32 GMT"

closes #207

@medyagh medyagh changed the title Override expire option to override remote image expire Dec 28, 2019
@willnorris
Copy link
Owner

I'll take a closer look at thing later, but my initial thought is that we should probably expose this through a "minCacheDuration" flag using flag.Duration. Then, we only use that value if it is longer than the cache duration from the origin server. (We can also set cache-control: public if that's necessary, though I can't remember the behavior of the httpcache package.)

Also, I'll probably want to put some kind of warning in the documentation for this, noting that it is overriding the instructions from the origin server and could cause problems if the origin is not expecting the image to be cached.

See also previous related feature requests: #28 #144

@medyagh
Copy link
Author

medyagh commented Dec 28, 2019

@willnorris that sounds reasonable to automatically set it to "public"
and also good idea to print a warning to the user.

admitably I don't know enough about other use cases of Cache-Control. so I set it to public assuming that is what would solve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature request: working offline
2 participants