Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Google JQuery CDN [https://ajax.googleapis.com] is banned in China #18367

Closed
ys2843 opened this issue May 19, 2020 · 8 comments · Fixed by #18369
Closed

Google JQuery CDN [https://ajax.googleapis.com] is banned in China #18367

ys2843 opened this issue May 19, 2020 · 8 comments · Fixed by #18369

Comments

@ys2843
Copy link
Contributor

ys2843 commented May 19, 2020

Description

In MXNet website, JQuery script is loaded from google CDN in <head>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

But this CDN is known banned in China, as you can see here:

Here is my own test using Chinese servers:

Screen Shot 2020-05-19 at 12 11 59 PM

It not only blocks website from loading, but also breaks all the interaction on MXNet website. (e.g. dropdown, installation guide, search etc. )

Error Message

ReferenceError: jQuery is not defined[Learn More]

Proposed solutions

While China is the number one country using the MXNet website. We need to solve this problem so that users in China can visit MXNet website without any problem. Here are 3 solutions:

  • Use an alternative CDN as a backup, for example CDN hosted in China , when google CDN fails then load the resource from backup CDN , as discussed in this question
  • Replace google CDN by another CDN
  • Hosting jQuery locally (Not preferable performance-wise, reasons can be found here )
@ys2843 ys2843 added the Bug label May 19, 2020
@ys2843
Copy link
Contributor Author

ys2843 commented May 19, 2020

@mxnet-label-bot add [Website]

@szha
Copy link
Member

szha commented May 19, 2020

jquery has its own CDN which isn't affected by the blocking of google CDN. so the simplest approach to try is to use that https://code.jquery.com/

could you summarize how the current website hosting works? to have more control on this we could use cloudfront for static hosting, which can also improve stability.

@sandeep-krishnamurthy
Copy link
Contributor

sandeep-krishnamurthy commented May 19, 2020

@ys2843 - Thanks for looking into this, is the jquery loading time causing huge delay in loading MXNet website in China?

I remember a ticket by @aaronmarkham for Apache Infra for CDN in China was closed. @szha - Is there a way to statically host in China and how to overcome with Apache processes?

@szha
Copy link
Member

szha commented May 19, 2020

ECharts project worked on CDN in China according to this board report: https://cwiki.apache.org/confluence/display/INCUBATOR/May2019

We may reach out to them for their experiences.

Update: in a later report they wrote: Redirecting echarts.baidu.com to echarts.apache.org. Because we found some speed problem of Apache CDN in China, we haven't done the redirecting job yet. We will do more test and ask for help if necessary.

Seems that using custom CDN is possible.

@ys2843
Copy link
Contributor Author

ys2843 commented May 19, 2020

jquery has its own CDN which isn't affected by the blocking of google CDN. so the simplest approach to try is to use that https://code.jquery.com/

could you summarize how the current website hosting works? to have more control on this we could use cloudfront for static hosting, which can also improve stability.

Good idea, we could simply replace google CDN with https://code.jquery.com/, tested with Chinese servers and it is reachable, although it is slightly slower than local CDN, but it saves the fallback time.
Currently MXNet website hosting is handled by Apache Infra team, according to Apache infra team:

MXNet is likely served from Japan for Chinese visitors.
We cannot at present get access to serve from China itself, the process for doing so is extremely convoluted due to Chinese government regulations. IF we are presented with an option that works in conjunction with MX records (aka not a CDN that relies on CNAME addresses), we will revisit our options and notify projects, but for the time being, we do not have any available options to speed up traffic for Chinese visitors.

Most of the resources are hosted locally with the website and the only thing not reachable is JQuery.

@szha
Copy link
Member

szha commented May 19, 2020

@ys2843 thanks for sharing. Is the speed adequate for the items hosted locally with the website? If so, you may also consider simply downloading the uglified javascript file and include it with the website codebase.

@ys2843
Copy link
Contributor Author

ys2843 commented May 19, 2020

@szha It is hard to tell about the speed of hosting it locally with website. But currently there are complains about the loading speed (Avg 19s) of MXNet website from China. Although include it with website codebase is definitely the most reliable way.
I would say for now we replace google cdn with Jquery cdn first to fix this blocker bug, and I will do more research on CDN possible choices, and reach out to EChart to see their experience.

@marcoabreu
Copy link
Contributor

Agree, I think replacing with jQuery CDN for now is the fastest and easiest way.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants