-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Should redirection response be temporarily instead of permanent #135
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
@jenkins-plone-org please run jobs |
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.
LGTM (assuming the full Plone test jobs are green)
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.
Let's wait for this discussion before we decide if we merge this PR:
My opinion. |
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.
I tested that this resolves an issue where renaming an item once and then renaming it back to the old name redirects indefinitely in Volto. This change is only for the API, and not server-side rendered pages, so I don't see how it can cause an SEO problem. I think we should go ahead and merge it.
@jenkins-plone-org please run jobs |
I'd like to discuss this with @sneridagh and @robgietema to gain a better understanding of how we can support a proper redirect on the frontend for SEO. I guess we would also have to amend the Volto frontend to take the new HTTP response code into account. It could be that we can handle API requests in a different way than regular HTTP requests to the frontend. |
@sneridagh @robgietema can we schedule a meeting today or tomorrow to discuss this? |
@tisto and I discussed this today. Currently if volto's server-side rendering does not serve an actual redirect response even if it got a redirect from the API. (The location is updated on the frontend afterward if the content's This would be easiest if we can put the logic in plone.rest to decide whether to use a permanent or temporary redirect based on whether the user is logged in. Then volto can simply pass along the response status from the API, instead of trying to guess which one is right. |
Discussion notesAttendeesNotes
|
@marciomazza will try to review/merge/release this today or over the weekend. Sorry, it took me ages to reach a conclusion on this and make a final decision... |
@davisagli we never created a ticket in plone.rest or anywhere else to tackle returning the correct 302 response code for anonymous users when they access a plone.app.redirector redirect URL, is that correct? |
@tisto What do you mean? Based on the discussion above I thought the remaining work was to make Volto SSR return a permanent redirect to anonymous users. There's some related discussion in plone/volto#4800 This PR changed plone.rest to always return a 302 redirect for API requests that involve a plone.app.redirector redirect. As discussed above, we can either update plone.rest to make a distinction in the response code based on whether the user is logged in or not -- or we can just handle that distinction in Volto. |
@davisagli ok, I am confused now. Let's talk about this in a video call. :) |
Notes:
|
See motivation here:
plone/plone.app.redirector#8
plone/plone.app.redirector#22
plone/volto#1095 (comment)