News for hackers. Stuff that matters.
Re:My fight against CDN libraries by mstaoru on Wednesday November 30, 2016 @08:24PM (#13076295)
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".

Re:My fight against CDN libraries by this-dang-guy on Wednesday November 30, 2016 @11:13PM (#13077119)
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"); }

Re:My fight against CDN libraries by en on Thursday December 01, 2016 @02:20AM (#13077797)
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.

Re:My fight against CDN libraries by annnnd on Thursday December 01, 2016 @09:13AM (#13079412)
How is that possible? You just download them and save them on your server... Unless you are worried about breaking some TOS?
Re:My fight against CDN libraries by laktak on Thursday December 01, 2016 @04:33AM (#13078258)
Re:My fight against CDN libraries by 9248 on Thursday December 01, 2016 @01:30AM (#13077624)
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' :)

Re:My fight against CDN libraries by romaniv on Thursday December 01, 2016 @10:34AM (#13080010)
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.
Re:My fight against CDN libraries by unhammer on Thursday December 01, 2016 @03:03AM (#13077975)
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...

Re:My fight against CDN libraries by danielrhodes on Thursday December 01, 2016 @05:44AM (#13078543)
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?
Re:My fight against CDN libraries by huxflux on Thursday December 01, 2016 @11:29AM (#13080607)
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)
Re:My fight against CDN libraries by yyhhsj0521 on Thursday December 01, 2016 @08:19AM (#13079138)
A combination of DNS pollution, HTTP Reset attack and IP ban.
Re:My fight against CDN libraries by cmdrfred on Thursday December 01, 2016 @08:11AM (#13079097)
I assume that Chinese censorship is not escaped just by using https, thus without DPI I assume it has to be IP related.
Re:My fight against CDN libraries by andruby on Thursday December 01, 2016 @10:46AM (#13080132)
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?
Re:My fight against CDN libraries by duckmysick on Thursday December 01, 2016 @03:27PM (#13083194)
Re:My fight against CDN libraries by saddestcatever on Thursday December 01, 2016 @10:56AM (#13080225)
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.
Re:My fight against CDN libraries by lisivka on Thursday December 01, 2016 @01:01PM (#13081699)
uMatrix
Re:My fight against CDN libraries by pritambarhate on Thursday December 01, 2016 @01:00AM (#13077525)
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?
Re:My fight against CDN libraries by samhamilton on Thursday December 01, 2016 @01:49AM (#13077685)
Yep social logins do break or make pages very very slow to load. (Expat in Shanghai)
Re:My fight against CDN libraries by samhamilton on Thursday December 01, 2016 @01:52AM (#13077698)
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
Re:My fight against CDN libraries by dsl on Friday December 02, 2016 @01:55AM (#13086696)
Funny, Privacy Badger blocks enough of www.jsdelivr.com that the site content fails to load.
Re:My fight against CDN libraries by herbst on Thursday December 01, 2016 @03:11PM (#13083044)
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.
Re:My fight against CDN libraries by throwawasiudy on Thursday December 01, 2016 @01:35AM (#13077646)
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.
Re:My fight against CDN libraries by deno on Thursday December 01, 2016 @04:21AM (#13078221)
You care about Chinese government’s censorship, but you don’t care about privacy from multinational corporations and governments?
Re:My fight against CDN libraries by xenophonf on Thursday December 01, 2016 @06:47AM (#13078752)
False equivalence - the one has nothing to do with the other.
Re:My fight against CDN libraries by deno on Thursday December 01, 2016 @06:52AM (#13078769)
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.
Re:My fight against CDN libraries by xenophonf on Thursday December 01, 2016 @09:12AM (#13079402)
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.
Re:My fight against CDN libraries by deno on Thursday December 01, 2016 @01:08PM (#13081753)
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.

Re:My fight against CDN libraries by klibertp on Thursday December 01, 2016 @09:29AM (#13079513)
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?

Re:My fight against CDN libraries by deno on Thursday December 01, 2016 @05:25PM (#13084133)
Hosting your assets locally is not “supporting censorship.”
Re:My fight against CDN libraries by christophilus on Thursday December 01, 2016 @09:02AM (#13079335)
Who says he/she doesn't care about privacy from multinational corporations? I care about both.
Re:My fight against CDN libraries by ocdtrekkie on Thursday December 01, 2016 @10:14AM (#13079830)
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.
Re:My fight against CDN libraries by bryanrasmussen on Thursday December 01, 2016 @09:36AM (#13079558)
I'm not sure that I would consider providing a fallback local copy of a library as going out of my way.
Re:My fight against CDN libraries by cptskippy on Thursday December 01, 2016 @10:49AM (#13080166)
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_...

Re:My fight against CDN libraries by throwawasiudy on Thursday December 01, 2016 @09:23PM (#13085448)
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.
Re:My fight against CDN libraries by banhfun on Thursday December 01, 2016 @03:14AM (#13078006)
Enjoy losing tons of potential users over your stubbornness for something that you could easily fix.
Re:My fight against CDN libraries by throwawasiudy on Thursday December 01, 2016 @05:42AM (#13078535)
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.
Re:My fight against CDN libraries by di4na on Thursday December 01, 2016 @04:35AM (#13078263)
Cost of having principles? Well not that bad then.
Re:My fight against CDN libraries by zp-j on Thursday December 01, 2016 @04:00AM (#13078154)
Didn't get it, put your jQuery in another CDN provider has anything to do with censorship?
Re:My fight against CDN libraries by throwawasiudy on Thursday December 01, 2016 @05:44AM (#13078546)
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.
Re:My fight against CDN libraries by erelde on Thursday December 01, 2016 @05:54AM (#13078581)
Meta question:

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

Re:My fight against CDN libraries by throwawasiudy on Thursday December 01, 2016 @09:27PM (#13085466)
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

Re:My fight against CDN libraries by erelde on Friday December 02, 2016 @02:27AM (#13086812)
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...
Re:My fight against CDN libraries by rmc on Thursday December 01, 2016 @07:06AM (#13078828)
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

Re:My fight against CDN libraries by throwawasiudy on Thursday December 01, 2016 @09:28PM (#13085468)
yeah I always make it obvious, no point in trying to pretend you're some guru.
Re:My fight against CDN libraries by ceejayoz on Thursday December 01, 2016 @08:03AM (#13079069)
Barring deliberately putting "throwaway" in the username, how would you propose HN's code determine between a throwaway and a normal brand new account?
Re:My fight against CDN libraries by erelde on Thursday December 01, 2016 @09:03AM (#13079342)
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.