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

Cache 301 redirect with a default timeout #29

Open
gajus opened this issue Feb 7, 2020 · 1 comment
Open

Cache 301 redirect with a default timeout #29

gajus opened this issue Feb 7, 2020 · 1 comment

Comments

@gajus
Copy link

gajus commented Feb 7, 2020

Currently 301 redirects are not cached at all unless the website returns a satisfying cache-control header. This is not how browsers work.

https://stackoverflow.com/questions/9130422/how-long-do-browsers-cache-http-301s

There should be a setting to cache 301 redirects for an arbitrary default time.

@kornelski
Copy link
Owner

The spec says:

https://tools.ietf.org/html/rfc7231#section-6.4.2

A 301 response is cacheable by default; i.e., unless otherwise
indicated by the method definition or explicit cache controls (see
Section 4.2.2 of [RFC7234]).

So caching it would be a good idea indeed. It can probably be similar setting to the default cache time heuristic.

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

No branches or pull requests

2 participants