Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I only represent about 0.00000013% of all Chinese Internet users, but let me chime in: EVERY website that uses Google CDNs for js or fonts just doesn't work here. It just keeps loading and loading, and loading forever. In most cases it's jQuery, and in most cases it's in the <head> so the page just never shows. Cloudflare (cdnjs), Amazon CDNs, Akamai CDNs also occasionally get blocked and take entire Internet segments with them.

If you use 3rd party CDNs, please consider implementing client-side failover strategy so you don't leave out 50% of the Internet "population".



For my new site, what I'm doing is a full fallback - local, cdn font, served from my site, then regular font-family fallback.

Not sure if that works properly in China, if it just spins. It might never 'fail' and fall back. I'd need to test that.

Like so: src: local('Slabo 13px'), local('Slabo13px-Regular'), url(https://fonts.gstatic.com/s/slabo13px/v3/B9U01_cNwYDvIHK04hX...) format('woff2'), url(https://fonts.gstatic.com/s/slabo13px/v3/fScGOqovO8xyProgHUR...) format('woff2'), url("/fonts/Slabo13px-Regular.ttf"); }


Maybe not the best solution, but for the js CDN of Google, I'am using a self hosted mirror with this list https://github.com/euh/googleapis-libraries-list

Unfortunately in HTTPS, I need to bypass HSTS protection and for Firefox it's annoying (I don't know for Chrome).

For the fonts I tried to create a self hosted mirror too, but Google does not offer to download exactly the exact fonts they host.


How is that possible? You just download them and save them on your server... Unless you are worried about breaking some TOS?



Funny thing, most if not all 'client-side failover' strategies you might find through google or the likes won't work either.

This is because the loaded resource will 'fail' anywhere between x seconds up to minutes, or never! In the meantime the user just sees a blank page, or best case, some 80-90% page that keeps trying to load something...

I've experienced this myself a couple times. Most probably my ISP messed up some stuff taking down whole chunks of 'internet' :)


The fact that browsers don't have any built-in mechanisms to load-balance resources it disappointing, but not surprising. Think about who are the main drivers of HTML specs. There is probably a way to implement such balancing manually, though. Either through loading parallel documents and exploiting cahcing or through using setTimeout and loading a different set of resources.


Local fallbacks also make it easier to do web dev when e.g. your wifi drops out and you can't see where it landed or you're on a boat or whatever.

I do things like http://stackoverflow.com/questions/7383163/how-to-fallback-t...


Is this a DNS block or an IP block? For example: if you serve assets from your domain but CloudFlare sits in front, do the assets still load?


Cloudflare work terrible in China! Actually it doesn't work at all as long as you don't buy there enterprise plan (and have an ICP)


A combination of DNS pollution, HTTP Reset attack and IP ban.


I assume that Chinese censorship is not escaped just by using https, thus without DPI I assume it has to be IP related.


Do you know of a way for a non-Chinese to test a website from your end? Is there a VPN or Bowser testing site that we can use?



I'm curious - do you know of any chrome plugins / client-side tools to help solve this problem? Seems like it could be very infuriating for the semi-competent Chinese internet user. Wouldn't be too bad to write a plugin that finds dependencies from "allowed"/"works-in-China" CDNs.


uMatrix


Thanks for sharing this. Is there a list of big domains such as Google which don't work in China? Does adding social logins like FB and G+ also makes the login pages to break?


Yep social logins do break or make pages very very slow to load. (Expat in Shanghai)


I feel your pain, when building my sites and if I use a 3rd party js/css cdn I use the only one I have found that has ICP and a damn good list of western nodes - jsdelivr.com


Funny, Privacy Badger blocks enough of www.jsdelivr.com that the site content fails to load.


Really glad about your comment, i honestly havent thought about this a single time yet. I guess i am missing out on a lot of traffic.


I don't like the censorship policies of the Chinese government. I'm not going to go out of my way to make sure my site is compatible with their censorship, use a VPN.


You care about Chinese government’s censorship, but you don’t care about privacy from multinational corporations and governments?


False equivalence - the one has nothing to do with the other.


They do, if you take a moralistic attitude, as op has. It’s hypocrisy. If you just don’t care about Chinese market then say so—don’t pretend you do so out of a moral obligation.


You're making assumptions about the beliefs of OP that aren't in evidence. A "moralistic attitude" (as you put it) can give greater weight to concerns about government censorship than to concerns about corporate respect for privacy rights. The two are quite different, even to an avowed anti-statist such as myself.


That’s why I stated it as a question.

I still think it’s hypocrisy to care about one and not the other. Those corporations are actually actively working to erode Internet freedoms, which affects everyone, not just a single country, and one that is not even democratic in the first place.

To get on your high horse over censorship in Asia while at the same time merrily include spying in your own code, as a simple convenience, nonetheless, is very much indefensible.


This is a very strange comment. First, there is no indication that GP doesn't care about the other things you mention. But more importantly: why don't you care about Chinese government's censorship? Are you saying that the censorship is OK because multinational corporations doing something? How is it even related?

It may not be your intention, but you appear to be defending the practice of censorship and demanding others to share your disinterest in the matter. That won't work, not because google and fb tracking everything on the web is good, but because censorship is bad.

EDIT: I'd like to know what made my downvoters do their thing?


Hosting your assets locally is not “supporting censorship.”


Who says he/she doesn't care about privacy from multinational corporations? I care about both.


Well, he seems to be defending the practice of using CDN libraries, and the article talks about how this practice, which he says he won't change, invades user privacy.


I'm not sure that I would consider providing a fallback local copy of a library as going out of my way.


Ultimately it comes down to who you want in your audience. If you don't care about reaching a Chinese audience then that's a perfectly reasonable stance.

The Berkman Center estimates that just 2-3% of users in censored markets use circumvention technologies. So you should be prepared to have your content pirated or your service cloned if it is of interest to a Chinese audience.

That's just the reality of the situation.

\* http://cyber.harvard.edu/sites/cyber.harvard.edu/files/2010_...


It will happen whether you build your website to be accessible there or not. They already cloned all the major sites used in the US and as soon as the Chinese version was off the ground the government blocked out all the foreign competitors.


Enjoy losing tons of potential users over your stubbornness for something that you could easily fix.


I'm sure Google, Uber, and countless other tech companies thought the same before they pulled out of China's market. Turns out China's government policies can be so hostile to outside tech companies that even the Mighty Google has decided it's not worth it. If I did make my site work great it could break again tomorrow or get banned for no apparent reason with no recourse.


Cost of having principles? Well not that bad then.


Didn't get it, put your jQuery in another CDN provider has anything to do with censorship?


spend time and resources making sure my site works and keeps working in a marketplace I have no interest in due to the government policies there? The reason I don't care has everything to do with censorship, and censorship ironically is the only reason the site wouldn't work right in the first place.


Meta question:

Why does HN allow throw away accounts? It seems to go against the idea of "internet karma".


Whenever I'm going to say something bad about anything more important than toilet paper I create a throwaway.

Even if the posts give you karma (which my throwaways are pretty universally positive karma) it isn't worth the downvote brigades every time the haters see you and occasional death threats.

throwaway accounts very much tie in with the concept of free speech and the open internet. If I don't want my personal safety tied to a few paragraphs of ranting there shouldn't be an issue with that. I should be able to speak my mind without fear of recourse.

Nobody is more interested in "internet karma" than the Chinese govt at the moment. Haven't you heard of the "online credit score" they're implementing? Everything you say and do online is tied to your real identity and has wide ranging effects on your well being. Needless to say there's some suggestions that this may affect free speech


I'm not against throw away accounts, I adhere to the idea of free speech anonymity provides. But if HN was a video game with a karma mechanism, I'd make it so users can't get around that central mechanism...


Because sometimes people feel free to talk if they are anonymous.

By calling the account "throwaway*" it tells people that this person is a regular and delibrately using a pseudonym


yeah I always make it obvious, no point in trying to pretend you're some guru.


Barring deliberately putting "throwaway" in the username, how would you propose HN's code determine between a throwaway and a normal brand new account?


Some subreddit have rules based on the account age.

I'd like to add, that I don't think I judged it in my wording. I've made throwaway accounts, but never on sites where discussion between users is the focus. I just don't really understand.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: