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

default redirect with 302 instead of 301 #1404

Merged
merged 1 commit into from
Oct 28, 2021
Merged

default redirect with 302 instead of 301 #1404

merged 1 commit into from
Oct 28, 2021

Conversation

dbu
Copy link
Member

@dbu dbu commented Oct 28, 2021

Q A
Branch? 2.0
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets fix #1260
License MIT
Doc PR ✔️

If we do a permanent redirect, the browser will usually cache this information and not call the controller anymore.

If the template contains the link to the controller, the permanent redirect saves unnecessary calls to the controller.

However, if the cached image is deleted, we again generate the URL to the controller - but the browser will remember the permanent redirect and directly request the image that is not existing. #1260 describes nginx configuration to work around this, but the default configuration should be robust rather than optimized and only working with specific nginx configuration.

@coveralls
Copy link

coveralls commented Oct 28, 2021

Coverage Status

Coverage remained the same at 85.55% when pulling b6f00ea on redirect-status-code into 7f5fa79 on 2.x.

@dbu dbu force-pushed the redirect-status-code branch from bddba74 to b6f00ea Compare October 28, 2021 09:27
@dbu dbu merged commit 5074fc6 into 2.x Oct 28, 2021
@dbu dbu deleted the redirect-status-code branch October 28, 2021 09:27
@Gamesh
Copy link
Contributor

Gamesh commented Oct 29, 2021

@dbu how is this not a BC break? it changes the default setting

@dbu
Copy link
Member Author

dbu commented Oct 29, 2021

BC is often tricky. what is a bugfix to somebody is a BC break to others.

i decided to do this change because using 302 instead of 301 does not break anything for a client. doing 301 breaks things in a sneaky way when clearing the cache, and the issue that brought this up showed that several people had been very confused by it.

@Gamesh
Copy link
Contributor

Gamesh commented Oct 29, 2021

i decided to do this change because using 302 instead of 301 does not break anything for a client

I would agree with you, if this was a client side javascript library 😄

i would consider it as a BC break as default behaviour changed and it should be at least mentioned as such in the changelog

@dbu
Copy link
Member Author

dbu commented Oct 30, 2021

i will add an explicit note about it in the changelog, agree that that is a good idea.

we use /~https://github.com/github-changelog-generator/github-changelog-generator that automatically collects all pull requests. convenient but less details than when updating changelog manually as the changes are merged.

@Gamesh
Copy link
Contributor

Gamesh commented Oct 30, 2021

Thank you 🙂

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.

Images not resolving when browser caching is enabled
3 participants