-
-
Notifications
You must be signed in to change notification settings - Fork 346
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 permanent redirects #3389
Conversation
We should make sure to cache only actually permanent redirects, i.e. those returned with a status code of 301 and 308.
|
The |
c8ba80a
to
9d086b2
Compare
Oof, good catches. Both done in force push. |
I'm not sure if restricting the Authorization header carry over logic to 301s and 308s as well is what we want here, in theory it also applies to other redirects. In practice though, we only get 301s where it's relevant, the only other redirect I see is the 302 from above, which also leads to another host and has separate authorization data baked into the URL. |
Ohhh. No, let me fix that. I forgot that there was more logic going on here than just the caching... |
9d086b2
to
442cb62
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks very good now, and works fine in my hacky testing.
Motivation
This is a follow-up to #3387. Passing the token after a redirect solved the error spam, but the Inflator will still attempt to retrieve out of date URLs even after the server tells us it is out of date.
Changes
Now we save HTTP redirects that we receive in a
Dictionary
and use them to skip the old URL if it is needed again. This will somewhat reduce our GitHub API usage, leaving more slack to index more mods.