You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2020/05/28 23:37:45 UTC
[GitHub] [incubator-mxnet] ys2843 opened a new pull request #18431: [website] Redirect Chinese visitors to Apache Chinese CDN provider
ys2843 opened a new pull request #18431:
URL: https://github.com/apache/incubator-mxnet/pull/18431
## Description ##
This PR is part1 of #18422 . It adds server side redirect logic according to users location ( suggested by accept-language). Currently this is the lowest delay and relatively accurate way for us to get the locale data from users. For Chinese speaking users outside China, the average website loading speed can still be under 2 seconds worldwide (tested the CDN in different countries).
There are 2 checks to each incoming HTTP requests.
1. Check user-preferred language first, if it starts with `zh` which stands for Chinese, we assume user is in China
2. Check host name in URL to ensure only redirect when user initially attempts to access the website. Avoid any loops and subsequent redirect.
If all conditions match, redirect user to Chinese CDN with same URI. For example, redirect from `https://mxnet.apache.org/features` to `https://mxnet.cdn.apache.org/features`
## Checklist ##
### Essentials ###
Please feel free to remove inapplicable items for your PR.
- [ ] The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant [JIRA issue](https://issues.apache.org/jira/projects/MXNET/issues) created (except PRs with tiny changes)
- [ ] Changes are complete (i.e. I finished coding on this PR)
- [ ] All changes have test coverage:
### Changes ###
- [ ] Add logic to redirect Chinese visitors to Apache's Chinese CDN provider
## Comments ##
- Preview: http://ec2-34-219-134-42.us-west-2.compute.amazonaws.com/
- In preview mode, following setting is used to stimulate the process:
```shell
RewriteCond %{HTTP:Accept-Language} ^zh
RewriteCond %{HTTP_HOST} ec2-34-219-134-42.us-west-2.compute.amazonaws.com
RewriteRule ^(.*) https://mxnet.cdn.apache.org%{REQUEST_URI} [R,NC,L]
```
- How to test:
Open Chrome, go to Settings. Search for "Languages", you can see a list of your preferred languages. And click "add languages" and select "Chinese". Then click on the three dot of "Chinese" option and select "move to top". Now visit the preview url you should see redirect.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-mxnet] marcoabreu commented on pull request #18431: [website] Redirect Chinese visitors to Apache Chinese CDN provider PART 1
Posted by GitBox <gi...@apache.org>.
marcoabreu commented on pull request #18431:
URL: https://github.com/apache/incubator-mxnet/pull/18431#issuecomment-636191705
Just checked with a tool and the results are as follows:
Original website: https://www.dotcom-tools.com/website-speed-test.aspx#2D4761ACDB144D809F0E16105FC25827
CDN website: https://www.dotcom-tools.com/website-speed-test.aspx#D08B03A9E383480C926C9946A86F6956
Generally, the original website is more consistent. The CDN has higher loading time on first as well as second visit.
Of course this would need more thorough inspection, but from the first look it seems like we should only use the CDN when there'a a specific issue we identified.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-mxnet] marcoabreu commented on pull request #18431: [website] Redirect Chinese visitors to Apache Chinese CDN provider PART 1
Posted by GitBox <gi...@apache.org>.
marcoabreu commented on pull request #18431:
URL: https://github.com/apache/incubator-mxnet/pull/18431#issuecomment-636097083
@mxnet-bot run ci [miscellaneous, unix-cpu]
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-mxnet] marcoabreu commented on pull request #18431: [website] Redirect Chinese visitors to Apache Chinese CDN provider PART 1
Posted by GitBox <gi...@apache.org>.
marcoabreu commented on pull request #18431:
URL: https://github.com/apache/incubator-mxnet/pull/18431#issuecomment-636193776
https://developers.google.com/speed/pagespeed/insights/?hl=en&url=https%3A%2F%2Fmxnet.apache.org%2F
https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fmxnet.cdn.apache.org%2F
You might also want to check out speed insights from google.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-mxnet] marcoabreu edited a comment on pull request #18431: [website] Redirect Chinese visitors to Apache Chinese CDN provider PART 1
Posted by GitBox <gi...@apache.org>.
marcoabreu edited a comment on pull request #18431:
URL: https://github.com/apache/incubator-mxnet/pull/18431#issuecomment-636191705
Just checked with a tool and the results are as follows:
Original website: https://www.dotcom-tools.com/website-speed-test.aspx#2D4761ACDB144D809F0E16105FC25827
CDN website: https://www.dotcom-tools.com/website-speed-test.aspx#D08B03A9E383480C926C9946A86F6956
Generally, the original website is more consistent. The CDN has higher loading time on first as well as second visit.
Of course this would need more thorough inspection, but from the first look it seems like we should only use the CDN when there'a a specific issue we identified.
Before taking such drastic steps I'd appreciate some A/B testing or further inspection before simply moving all users to a different host. Apache servers are in our control but others might not.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-mxnet] ys2843 edited a comment on pull request #18431: [website] Redirect Chinese visitors to Apache Chinese CDN provider PART 1
Posted by GitBox <gi...@apache.org>.
ys2843 edited a comment on pull request #18431:
URL: https://github.com/apache/incubator-mxnet/pull/18431#issuecomment-635673582
@mxnet-label-bot add []
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-mxnet] sandeep-krishnamurthy merged pull request #18431: [website] Redirect Chinese visitors to Apache Chinese CDN provider PART 1
Posted by GitBox <gi...@apache.org>.
sandeep-krishnamurthy merged pull request #18431:
URL: https://github.com/apache/incubator-mxnet/pull/18431
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-mxnet] ys2843 edited a comment on pull request #18431: [website] Redirect Chinese visitors to Apache Chinese CDN provider PART 1
Posted by GitBox <gi...@apache.org>.
ys2843 edited a comment on pull request #18431:
URL: https://github.com/apache/incubator-mxnet/pull/18431#issuecomment-635673582
@mxnet-label-bot add [website, pr-awaiting-merge]
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-mxnet] ys2843 edited a comment on pull request #18431: [website] Redirect Chinese visitors to Apache Chinese CDN provider PART 1
Posted by GitBox <gi...@apache.org>.
ys2843 edited a comment on pull request #18431:
URL: https://github.com/apache/incubator-mxnet/pull/18431#issuecomment-635673582
@mxnet-label-bot update [website, pr-awaiting-merge]
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #18431: [website] Redirect Chinese visitors to Apache Chinese CDN provider
Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #18431:
URL: https://github.com/apache/incubator-mxnet/pull/18431#issuecomment-635672656
Hey @ys2843 , Thanks for submitting the PR
All tests are already queued to run once. If tests fail, you can trigger one or more tests again with the following commands:
- To trigger all jobs: @mxnet-bot run ci [all]
- To trigger specific jobs: @mxnet-bot run ci [job1, job2]
***
**CI supported jobs**: [windows-gpu, sanity, windows-cpu, unix-gpu, unix-cpu, clang, centos-gpu, miscellaneous, website, edge, centos-cpu]
***
_Note_:
Only following 3 categories can trigger CI :PR Author, MXNet Committer, Jenkins Admin.
All CI tests must pass before the PR can be merged.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-mxnet] ys2843 commented on pull request #18431: [website] Redirect Chinese visitors to Apache Chinese CDN provider PART 1
Posted by GitBox <gi...@apache.org>.
ys2843 commented on pull request #18431:
URL: https://github.com/apache/incubator-mxnet/pull/18431#issuecomment-635673582
@mxnet-label-bot add [website, pr-awaiting-review ]
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-mxnet] ys2843 commented on pull request #18431: [website] Redirect Chinese visitors to Apache Chinese CDN provider PART 1
Posted by GitBox <gi...@apache.org>.
ys2843 commented on pull request #18431:
URL: https://github.com/apache/incubator-mxnet/pull/18431#issuecomment-636189548
> This is great. Anecdotally, the cdn is faster for me and I'm in California. Maybe we should just use the CDN for all traffic? We heard from another community member in Australia that the site is slow there too... wdyt?
Yeah, I will reach out to Apache to get more info about this, whether it is allowed to redirect more/all users to this CDN, or if they can point official website ip to it. But I guess it will take some time to address this issue, while this is a Chinese CDN provider that might be out of Apache's control.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-mxnet] ys2843 edited a comment on pull request #18431: [website] Redirect Chinese visitors to Apache Chinese CDN provider PART 1
Posted by GitBox <gi...@apache.org>.
ys2843 edited a comment on pull request #18431:
URL: https://github.com/apache/incubator-mxnet/pull/18431#issuecomment-635673582
@mxnet-label-bot add [website, pr-awaiting-merge ]
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #18431: [website] Redirect Chinese visitors to Apache Chinese CDN provider PART 1
Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #18431:
URL: https://github.com/apache/incubator-mxnet/pull/18431#issuecomment-636097144
Jenkins CI successfully triggered : [miscellaneous, unix-cpu]
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-mxnet] marcoabreu commented on pull request #18431: [website] Redirect Chinese visitors to Apache Chinese CDN provider PART 1
Posted by GitBox <gi...@apache.org>.
marcoabreu commented on pull request #18431:
URL: https://github.com/apache/incubator-mxnet/pull/18431#issuecomment-636194055
@ys2843 please make sure to discuss topics (like generally considering a move to a CDN) on dev@ before reaching out to Apache Infra.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-mxnet] ys2843 commented on pull request #18431: [website] Redirect Chinese visitors to Apache Chinese CDN provider PART 1
Posted by GitBox <gi...@apache.org>.
ys2843 commented on pull request #18431:
URL: https://github.com/apache/incubator-mxnet/pull/18431#issuecomment-636196866
> Just checked with a tool and the results are as follows:
>
> Original website: https://www.dotcom-tools.com/website-speed-test.aspx#2D4761ACDB144D809F0E16105FC25827
> CDN website: https://www.dotcom-tools.com/website-speed-test.aspx#D08B03A9E383480C926C9946A86F6956
>
> Generally, the original website is more consistent. The CDN has higher loading time on first as well as second visit.
>
> Of course this would need more thorough inspection, but from the first look it seems like we should only use the CDN when there'a a specific issue we identified.
>
> Before taking such drastic steps I'd appreciate some A/B testing or further inspection before simply moving all users to a different host. Apache servers are in our control but others might not.
Agreed,
> @ys2843 please make sure to discuss topics (like generally considering a move to a CDN) on dev@ before reaching out to Apache Infra.
Yes, sure. This should be further discussed within the team before moving on. Currently fixing the website in China is what this project primarily aims.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org