镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
This repository was 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

Description

@ys2843

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 )

Activity

  1. ys2843 commented on May 19, 2020

    @ys2843
    ContributorAuthor

    @mxnet-label-bot add [Website]

  2. szha commented on May 19, 2020

    @szha
    Member

    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.

  3. sandeep-krishnamurthy commented on May 19, 2020

    @sandeep-krishnamurthy

    @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?

  4. szha commented on May 19, 2020

    @szha
    Member

    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.

  5. ys2843 commented on May 19, 2020

    @ys2843
    ContributorAuthor

    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.

  6. szha commented on May 19, 2020

    @szha
    Member

    @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.

  7. ys2843 commented on May 19, 2020

    @ys2843
    ContributorAuthor

    @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.

  8. marcoabreu commented on May 19, 2020

    @marcoabreu
    Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions