With en-US or a unknown locale: / -> /firefox/ -> /en-US/firefox/ -> /en-US/firefox/new/ (or /en-US/firefox/fx/) With fr, this is: / -> /firefox/ -> /fr/firefox/ This is really bad for performance, it means 2 or 3 round trips to the servers in the US before receiving content. This means at the very least 500ms, even in the US. We should figure out a way to do just one redirect.
I am in favour of having locale detection setup on www.firefox.com, not just a plain redirect to mozilla.com Now: www.firefox.com -> www.mozilla.com/firefox/ -> www.mozilla.com/fr/firefox/ Should be: www.firefox.com -> www.mozilla.com/fr/firefox/
Would we get a performance gain by removing the redirect for en-US visitors? I'm thinking mozilla.com/en-US/ would become mozilla.com/ and we'd redirect users only if we don't want them to see the English site.
(In reply to comment #2) > Would we get a performance gain by removing the redirect for en-US visitors? > I'm thinking mozilla.com/en-US/ would become mozilla.com/ and we'd redirect > users only if we don't want them to see the English site. I think that would require varying our cache on accept-language, which has so much variation that our cache would be ineffective. It'd also require changing our locale detection and prefetch code. I don't think it's possible, nor worth it, to remove that one.
okay, thanks Alex.
Created attachment 503504 [details] [diff] [review] Patch I've taken a lot of code from prefetch.php for this. It should be one redirect now.
(In reply to comment #5) > Created attachment 503504 [details] [diff] [review] > Patch > > I've taken a lot of code from prefetch.php for this. > > It should be one redirect now. I think you shouldn't duplicate any code into this new file. With this patch, if someone wanted to change locale detection in the future, they'd have to change it in two places. Also, why create index.php? prefetch.php will get run on that page anyway. Could you move your logic into prefetch.php?
Comment on attachment 503504 [details] [diff] [review] Patch I had the same concern as Alex, that there's code duplication.
Attachment #503504 - Flags: feedback?(steven) → feedback-
Created attachment 504509 [details] [diff] [review] Patch I thought it would be simpler from a logic perspective to duplicate the code. Maybe we can speed up the mobile redirection by the way.
Comment on attachment 504509 [details] [diff] [review] Patch Works well, easy gain
Attachment #504509 - Flags: review?(pascalc) → review+
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
pushed to production r81574
verified fixed curl -I http://www.mozilla.com HTTP/1.1 302 Found Server: Apache X-Backend-Server: pm-web02 Vary: Accept-Encoding Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0, private Content-Type: text/html; charset=UTF-8 Date: Tue, 25 Jan 2011 19:45:37 GMT Location: http://www.mozilla.com/en-US/firefox/ Pragma: no-cache Transfer-Encoding: chunked Connection: Keep-Alive X-Powered-By: PHP/5.2.9 X-Cache-Info: not cacheable; response specified "Cache-Control: no-store"
Status: RESOLVED → VERIFIED
Component: www.mozilla.org/firefox → www.mozilla.org
Product: Websites → Websites
Component: www.mozilla.org → General
Product: Websites → www.mozilla.org
You need to log in before you can comment on or make changes to this bug.