User tests: Successful: Unsuccessful:
Pull Request for Issue #11165.
This PR reviews the HTTP status code of the redirects in the language filter plugins (current all are non cached 301 Moved Permanently).
After this PR the behaviour is the following:
/defaultlang*
to /*
(remove language code is set to Yes) = 301 Moved Permanently/*
to /defaultlang*
(remove language code is set to No) = 301 Moved Permanently (not cached)/*
to /otherlang*
(cookie language based redirect) = 302 FoundSee discussion in #11196
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
I have tested this item
See my above comment
no, we can not allow any redirection to be cached, that is what we fixed recently
e.g. using language code in the URL for default language
now in this last case, we tell browser to cache it then we break the language switching again, that what we recently fixed
Something still doesn't feel right but you're all the ones dealing with this behavior so I leave it to your capable hands.
Something still doesn't feel right ...
you are right that it would be nicer to allow caching of some redirects e.g. cache 301 for default language,
but we also need to support the language switching with all possible configurations ...
i just say that this PR does not deal with the topic that you discuss, other PR have dealt with the above,
and this last purpose is succeeded in my tests that is why i marked a successful test
What's the benefit to not caching the second scenario? Something in my gut tells me this isn't the most optimal behavior.
Scenario: you have a site with /en/
(default langauge) and /fr/
If you use a 301 cached redirect.
First time you access /
you get a 301 from /
to /en/
and this will be cached in the browser.
So now you changed to /fr/
and navigate a little.
Now, while you are in french you access /
trought a link (home logo for instance) or direct input. Since the 301 was cached before will go to /en/
(instead of going to /fr/
), i.e, it will override the language cookie behaviour.
So we can't cache it.
OK that makes sense.
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC. We now get the correct redirections afaik
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-07-20 09:35:52 |
Closed_By | ⇒ | wilsonge |
Labels |
Removed:
?
|
What's the benefit to not caching the second scenario? Something in my gut tells me this isn't the most optimal behavior.