2 or 3 redirections before displaying homepage

VERIFIED FIXED in 1.1

Status

www.mozilla.org
General
VERIFIED FIXED
8 years ago
6 years ago

People

(Reporter: rik, Assigned: rik)

Tracking

({perf})

unspecified

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [post redesign])

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

8 years ago
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/

Updated

8 years ago
Whiteboard: [post redesign]

Comment 2

8 years ago
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.

Comment 4

8 years ago
okay, thanks Alex.
(Assignee)

Comment 5

8 years ago
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.
Assignee: nobody → anthony
Attachment #503504 - Flags: review?
Attachment #503504 - Flags: feedback?
(Assignee)

Updated

8 years ago
Attachment #503504 - Flags: review?(pascalc)
Attachment #503504 - Flags: review?
Attachment #503504 - Flags: feedback?(steven)
Attachment #503504 - Flags: feedback?
(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-
(Assignee)

Comment 8

8 years ago
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.
Attachment #503504 - Attachment is obsolete: true
Attachment #504509 - Flags: review?(pascalc)
Attachment #504509 - Flags: feedback?(steven)
Attachment #503504 - Flags: review?(pascalc)
Comment on attachment 504509 [details] [diff] [review]
Patch

Works well, easy gain
Attachment #504509 - Flags: review?(pascalc) → review+
(Assignee)

Comment 10

8 years ago
Committed r81247 to trunk and r81249 to stage.
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Keywords: qawanted
Resolution: --- → FIXED
(Assignee)

Updated

8 years ago
Target Milestone: --- → 1.1
qa-verified-trunk www.authstage.mozilla.com
Keywords: qawanted
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
Attachment #504509 - Flags: feedback?(steven)
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.