Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Google’s CDN for jQuery available in China?

Does anyone know if Google's CDN for jQuery is available in China?

http://code.google.com/apis/ajaxlibs/

I might have a project where I'll need to support localization a variety of countries, including mainland China, and want to know if I'll need to find alternatives such as:

http://www.asp.net/ajax/CDN/

Which is okay, but my understanding is that the Microsoft CDN doesn't support jQuery UI.

I've checked over at the following Google report page, but can't really figure out if 'sites' includes their CDN delivery: http://www.google.com/prc/report.html

like image 894
Dean Peters Avatar asked Apr 09 '10 12:04

Dean Peters


People also ask

Is jQuery blocked in China?

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

Is Google available in China?

Google, Facebook and Twitter are all blocked in China due to the country's Great Firewall. They can usually only be accessed via virtual private networks or VPNs. The Tuber browser has now disappeared from app stores and its website no longer works.

Which CDN is used in jQuery?

A jQuery CDN has two types: traditional pull jQuery UI CDN and reverse proxy jQuery UI CDN.

What is the best jQuery CDN?

The best-performing CDN depends a bit on your needs. If you don't need HTTPS support, the fastest CDN is actually the official jQuery CDN, provided by Media Temple. Google's Libraries API CDN is a good second choice after that. If you need support for HTTPS, your best option is Google's Libraries API CDN.


2 Answers

You could always consider loading an alternative JQuery source (maybe your own) if the CDN is not available. A fall-back copy if you will. Scott Galloway had a good article on it, something like this should be OK:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js"></script>

<script type="text/javascript">
  if (typeof jQuery == 'undefined')
  {
     document.write(unescape("%3Cscript src='/Scripts/jquery-1.4.2.min.js' type='text/javascript'%3E%3C/script%3E"));
     document.write(unescape("%3Cscript src='/Scripts/jqueryui-1.7.2.min.js' type='text/javascript'%3E%3C/script%3E"));
  }
  </script>

I appreciate that this doesn't actually check if your visitors can access the CDN, but it's a good solution for making sure your site still works. (Even works in offline development mode this way) :)

like image 54
Amadiere Avatar answered Oct 11 '22 07:10

Amadiere


Nop . It is can not be refereed to as "available" nor "reliable" .

undependable, untrustworthy, irresponsible, fickle, capricious, irregular, erratic, unpredictable, inconstant, mutable, slippery, fragile and arbitrary might be more accurate description ( all together and also each separately ).

China´s internet and communications regulations and laws are vigorously implemented by provincial political branches of state-owned ISPs, business companies, and organizations - each implementing it´s own censorship systems as it see fit .

These systems are also periodically updated in relation to current political or geopolitical events. For example, in the week of a party summit , the censorship is much more strict and the systems get "hardened". Another example is the transition period between governments ( also local ) or the hosting of world wide events like the olympics, Asia games etc . again - those changes are LOCAL and PERIODICAL.

In other words, very hard to predict - but with a clear pattern.

Add on top of that the fact that the Chinese laws and regulations ( due to the language itself ) are widely and wildly open for interpretation of the local senior and junior officers as they see fit - and what you have is the wonderful chaos that is so characteristic of China.

The Chinese government began disabling certain searches or blocking the results - but since the systems are local , and not always given to the right political or technical officer - it can result in blocking a whole range of services like google maps, fonts, CDN Etc. ( not to mention affecting every site that Embades a tweet or facebook feed with a 500% increase on load time - and in many cases even a timeout failure )

The end result is that each of the answers that people wrote above is true and not true at the same time . If someone answer "yes, it works" it actually means "yes , it works FOR ME , at my CURRENT location, at the CURRENT TIME "

The same is true for the opposite .

My own experience is after about 5 years working in china is around 65% failure.

EDIT : This is how this SE site looks like in china when CDN fails..

Stack overflow when CDN fails ..

AND ..

Funny fact : In china , after uploading that image above , I myself can not view it .. :-)

Another form of faild CDN ( image hosting )

like image 30
Obmerk Kronen Avatar answered Oct 11 '22 07:10

Obmerk Kronen