-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[website] Redirect Chinese visitors to Apache Chinese CDN provider PART 1 #18431
[website] Redirect Chinese visitors to Apache Chinese CDN provider PART 1 #18431
Conversation
Hey @ys2843 , Thanks for submitting the PR
CI supported jobs: [windows-gpu, sanity, windows-cpu, unix-gpu, unix-cpu, clang, centos-gpu, miscellaneous, website, edge, centos-cpu] Note: |
@mxnet-label-bot update [website, pr-awaiting-merge] |
@mxnet-bot run ci [miscellaneous, unix-cpu] |
Jenkins CI successfully triggered : [miscellaneous, unix-cpu] |
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.
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. |
Just checked with a tool and the results are as follows: Original website: https://www.dotcom-tools.com/website-speed-test.aspx#2D4761ACDB144D809F0E16105FC25827 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. |
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. |
@ys2843 please make sure to discuss topics (like generally considering a move to a CDN) on dev@ before reaching out to Apache Infra. |
Agreed,
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. |
52b5b73
to
8d0c3be
Compare
…RT 1 (apache#18431) * website - redirect Chinese visitors to Apache Chinese CDN provider * switch to mod_geoip for most accurate redirecting Co-authored-by: Yang Shi <[email protected]>
…RT 1 (apache#18431) * website - redirect Chinese visitors to Apache Chinese CDN provider * switch to mod_geoip for most accurate redirecting Co-authored-by: Yang Shi <[email protected]>
Description
This PR is the part1 of #18422 .To fix slow site speed in China and improve overall loading speed. It adds server side logic to redirect Chinese visitors to Chinese CDN based on Geo IP. This is the most accurate and fastest way to filter visitors.
There are 2 checks to each incoming HTTP requests.
CN
If all conditions match, redirect user to Chinese CDN with same URI. For example, redirect from
https://mxnet.apache.org/features
tohttps://mxnet.cdn.apache.org/features
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
Changes
Comments
http://ec2-34-219-134-42.us-west-2.compute.amazonaws.com/testgeoip.php
, you should see your ip and geolocation data.Following settings are used to stimulate the process:
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^CN$ RewriteCond %{HTTP_HOST} ec2-34-219-134-42.us-west-2.compute.amazonaws.com RewriteRule ^(.*) https://mxnet.cdn.apache.org%{REQUEST_URI} [R,L]