
So you want your app/website to work in China - chanind
https://chanind.github.io/china/2019/01/19/launching-an-app-or-website-in-china.html
======
victornomad
My best best advices are not listed there

\- Stop using Google CDNs

\- Stop using Google fonts

\- Don't put Google Analytics in the header (or don't use it) otherwise will
block/delay the browser load the website.

Most of the websites just timeout because of those 3 things and make the
website imposible to navigate.

If you host your website in a normal VPS, without using Google services you
will have a quite nice chance that the website loads pretty fast there in
China.

edit: formatting

~~~
tonyaiken
You can still use them, but a different URL. Google has a CDN in China for
those fonts and stuff. Also Google Analytics are not blocked at all in China.

~~~
lawrencegs
How about Recaptcha?

~~~
intellix
I'm thinking that generally it works but the other night during the nightly
internet apocalypse I had to disable it all to use my own site.

Will have to double check...

~~~
intellix
yep, during the day you don't really notice cause VPNs work etc but once it
gets to night, everything stops working

------
yixiang
I'm Chinese. It's not that bad.

* I've been hosting my Chinese blog in US vps since 2009 and it works fine.

* I have Gitea hosted in US vps and it works fine too.

* GoDaddy has Alipay (sort of China's PayPal) up for a long time.

* ICP Licenses are easy to get (at least for Chinese) and typically take less a month. I've done it for my company's websites and my clients' websites.

* ICP licenses are required only if you want to host your website in China. Hosting in China is ridiculously expensive and many Chinese go out of their way to host elsewhere. For 9$ a month you get 1 cpu, 1G ram and 1MBit bandwidth, which translates to 128kb/s.

To make your website load, and load fast in China:

* Remove Google fonts, Google cdn, resources from FB, twitter, etc. this should fix 95% of your problem.

* Avoid well-known host providers (AWS, Vultr, Linode) if you can, they tend to get banned.

* Get a host with CN2. I heard hosting in Hong Kong is fast too. It's only necessary if you really want your site to be lightning fast. As a Chinese, if I'm visiting your website and your website is in English, then I probably expect it to be slow, so...

~~~
continuations
> Hosting in China is ridiculously expensive and many Chinese go out of their
> way to host elsewhere

If I host in Europe or US would the speed of traffic going into China be very
slow?

If I get a 1Gbps server in EU most likely I can serve 1Gbps to USA. Will I be
able to serve 1Gbps to China from that EU server?

> For 9$ a month you get 1 cpu, 1G ram and 1MBit bandwidth

That is insanely expensive. How can startups in China handle that kind of
hosting cost? Where do they host their websites?

> Get a host with CN2

What's CN2? Where can I find their website?

~~~
oefrha
Having used Alibaba Cloud for the past few years, and having been in China for
the past month, I would say:

> If I host in Europe or US would the speed of traffic going into China be
> very slow? ... Will I be able to serve 1Gbps to China from that EU server?

Not sure about 1Gbps, but I've seen my 200Mbps band basically saturated. It's
rather spotty though -- definitely not 200Mbps all the time. Latency is a very
big problem here, so make sure you do TCP tuning right; without TCP tuning you
might see awful speeds.

> That is insanely expensive. How can startups in China handle that kind of
> hosting cost? Where do they host their websites?

The insanely expensive part is bandwidth. For instance with Alibaba Cloud, a 1
vCPU, 1G RAM, 20G SSD instance with pay-as-you-go network billing is like
$6/mo so it's not that bad, and there are promotions year round so if you're
committed for say one year at a time you can usually get it for maybe half the
list price, but outbound bandwidth is a whopping $0.123/GB (which is actually
not that different from AWS/GCP's Asia pricing).

I don't know about startups but I suppose it's fine if you host static assets
through a CDN and only use the expensive bandwidth from compute for truly
dynamic content.

~~~
continuations
> so make sure you do TCP tuning right; without TCP tuning you might see awful
> speeds.

Any suggestions on how to tune TCP for this situation?

> I suppose it's fine if you host static assets through a CDN and only use the
> expensive bandwidth from compute for truly dynamic content.

Wouldn't the bandwidth cost of CDN be even higher than that of Alibaba Cloud?

~~~
oefrha
> Any suggestions on how to tune TCP for this situation?

Roughly speaking, TCP throughput is window size / latency, and the default
window size on Linux is usually pretty small, so for high latency connections
(US to CN roundtrip is usually several hundred ms) the throughput would be
bad. Increasing TCP buffer sizes goes a long way. In addition to buffer sizes,
finer tuning is possible via other options/parameters; just find a guide
online, there are plenty.

> Wouldn't the bandwidth cost of CDN be even higher than that of Alibaba
> Cloud?

Hmm, shouldn't CDNs for static assets be cheaper than bandwidth associated
with compute instances in general? For instance, Alibaba Cloud's CDN offering
starts at $0.04/GB (in Mainland China) for the first 50TB, and gradually
decreases from there.[1]

[1]
[https://www.alibabacloud.com/product/cdn/pricing](https://www.alibabacloud.com/product/cdn/pricing)

------
zoom6628
Ive lived in mainland China most of last 12 years and work in software. The
last paragraph is key one for most websites. You have to remove use of all G,
FB and related site scripts because these will not run. There are good
alternatives anyway so do yourself a favor and replace them with self-hosted
or other 3rd party alternatives.

There are sites for testing what is blocked in China - you should test all 3rd
party scripts you are using to make sure they run ok.

~~~
rqs
Just read the article again only to realize the late paragraph was not "Good
luck! Please enable JavaScript to view the comments powered by Disqus." LOL

Anyway, before I had a stable proxy, I actually set up my local DNS to
redirect all .google.com., .facebook.com. and their CDNs to 127.0.0.1 just so
I can "unblock" some other webpages. That was not a good experience.

Those script can actually be delayed from loading so they won't block the
page. You don't need to actually remove them, just load them AFTER your page
is loaded, and then most things will be fine. (Except for Google Recaptcha of
course)

It's a good practice to un-trust everything you don't have control, and maybe
make exceptions from there. Don't by default trust everything.

------
crazygringo
I'm really confused.

I have a fairly international website geared towards English language
learners, with Google Analytics and AdSense and links to share on Facebook,
hosted on Digital Ocean here in NYC...

and, without designing for it, China has been my #1 source of traffic and
revenue for many years now, simply because they're the #1 largest population
of English language learners.

It seems to be working fine. I mean, maybe my share of Chinese traffic could
be even bigger, but does anyone have any hard numbers showing this is a
problem? Or are Chinese users aware of slow loads but just put up with it?

~~~
chillacy
VPN usage is popular, even more so among the educated who might want to
improve their English. That’s who you’re targeting anyways right?

~~~
netheril96
Those who connect to their website through VPN will not show up with an IP
inside China mainland.

------
elamje
Not that this is a recommended solution, but VPNs work from inside of China.

I lived with some Chinese students while I was exchanging and basically they
said most people that want out of the Fire wall can just VPN out with no
repercussions expected. Not that it’s ideal, but some commenters seem to
believe that people in China have no access to the outside world which just
isn’t true.

Before the internet the USSR could censor effectively, but now it’s pretty
hard with encryption being as good as it is.

Of course there are people in China that don’t know that VPNs exist, but I
think it’s an important nuance to mention that many people are able to have an
open online experience.

~~~
hw
Didn't China ban VPN or at least started to issue fines to people who were
caught using VPNs? Unless they backtracked on that..

~~~
PakG1
Yes, that parent comment must be old information.

[https://www.scmp.com/news/china/policies-
politics/article/21...](https://www.scmp.com/news/china/policies-
politics/article/2109618/man-jailed-selling-vpns-evade-chinas-great-firewall)

[https://www.scmp.com/news/china/policies-
politics/article/21...](https://www.scmp.com/news/china/policies-
politics/article/2125326/man-jailed-51/2-years-fined-us76000-selling-vpn)

[https://www.scmp.com/tech/policy/article/2180960/chinese-
vpn...](https://www.scmp.com/tech/policy/article/2180960/chinese-vpn-user-
fined-accessing-overseas-websites-part-beijings-ongoing)

As well, I think the Chinese government has demonstrated multiple times during
"sensitive times" in recent years that they can make commercial VPN services
nonfunctional at the snap of a finger. If a commercial VPN service is working,
it is because of the Chinese government's mercy, not because of the commercial
VPN's technological ingenuity.

It leaves a bad taste in my mouth when I see commercial VPN providers
advertising that they are the best or only VPN service to work in China. I
remember one time I saw a viral Astrill ad floating around that said something
to the effect: "We're happy that our VPN service is working great for our
customers. But please don't post that your VPN service is working great. We
work really hard to develop new technologies and get around the Chinese
firewall, and if you keep bragging about it, the Chinese government could find
out, it will make it harder for our services to work."

Super bad taste in my mouth. Come on, you know that the very first customers
to download new clients are from the Chinese government working to figure out
how to get it blocked. Hate this kind of disingenuous marketing.

edit: I will say that it is true that most commercial VPN services do seem to
be used for most of the year and work well enough without consequences; the
law seems to exist, but does not always get enforced. Would be interesting to
see if China starts ratcheting up the fines over time.

~~~
teknologist
Most, if not all of them, use fixed IP addresses which would be trivial to
block regardless of what hip new crypto schemes they're running. Any customer
can get the full server list too - worth it to a censor for $5.

The only real threat is something like Tor which is very aggressively and
actively probed/blocked in China.

------
butytho
It’s really interesting how many HN users continuously engage in whataboutism
and praise China every time any criticism of China comes up.

[https://arstechnica.com/information-
technology/2016/06/red-a...](https://arstechnica.com/information-
technology/2016/06/red-astroturf-chinese-government-makes-millions-of-fake-
social-media-posts/)

[https://en.m.wikipedia.org/wiki/Internet_Water_Army](https://en.m.wikipedia.org/wiki/Internet_Water_Army)

[https://news.ycombinator.com/item?id=17103136](https://news.ycombinator.com/item?id=17103136)

------
morkfromork
I want the opposite. I want to block China and Russia and a few other
countries that constantly try to hack my site.

~~~
matthew-wegner
You can block whole countries with the free CloudFlare tier. (Or give them
CAPTCHA style challenges)

~~~
slig
Can you now? A while ago it's possible to block countries in the free tier,
but it was a bug and they reverted.

------
ashton314
I traveled to China for about a month and a half a few years ago. Everything
was excruciatingly slow. Except for Hacker News. Probably more about the
payload size than anything else. :)

How many companies work hard to make their services readily available in
China? Any notable exceptions?

~~~
massivecali
Offtopic, but HN has always been a reliable check for me as to whether or not
I have data service or it's just extremely slow as it always loads.

~~~
snazz
HN occasionally becomes very, very slow (30-second load times), but usually
this is just if you’re logged in and requesting templated content, as the
front page is cached and loads instantly on a non-logged-in device. It does
make a good connection test!

------
tilolebo
My 2 cents running your app in China:

* make it as decoupled as possible from your core infra. What you spare on infra costs caused by redundancy, you will spend in maintenance time, outage mitigation, etc.

* no synchronous call going out of China mainland, otherwise you become dependent of the Great Firewall and that is not something you want

* expect lower quality of documentation and support

------
chvid
"Sadly, it’s not so simple. If your app/website servers aren’t hosted from
within China, then, for all intents and purposes, it’s blocked. I mean, it
will probably technically load, but will be excruciatingly, unusably slow. And
sometimes it will just not load at all for hours at a time."

Is that really correct? And are there any sort of systematic measurements of
that?

I seem to remember from my travels in China that accessing my websites hosted
in Denmark was ok, certainly not stellar, but better than Australia.

(The rest of the advice: Don't use FB and Google - absolutely a good idea.)

------
zzzeek
I host sqlalchemy.org on Linode, it has a google analytics loader on it, and
I've had several complaints that the website cannot be loaded in many regions
of China.

~~~
oefrha
It's not GA which is not blocked in China; I think sqlalchemy.org itself
somehow ended up on the GFW blocklist (beats me why that would happen).

I'm in China right now, and

    
    
        $ curl -v http://sqlalchemy.org/
        *   Trying 45.33.79.102...
        * TCP_NODELAY set
    

Then it just hangs. Meanwhile, my sites hosted in the same Linode datacenter
(Newark, NJ) work fine.

------
icedchocolate
Honestly, I wouldn’t make it available in China. I want to give them a reason
to take that firewall down. I don’t want to make the prison that their
government has turned their country into, a sustainable one.

~~~
jstanley
If you block Chinese people from viewing your website, you're only hurting
Chinese people. The government doesn't give a shit about your website or your
users.

The internet is a place that can exist without borders, there's no reason for
us to voluntarily erect any.

~~~
vorpalhex
The government is ultimately at the mercy of its people. If they can't access
the things they want, then that will add to their issues with the government.

------
Can_Not
I really want the opposite, I want Google Cloud to stop billing me for Chinese
users I don't have. Apparently the technology to bill me extra for Chinese
bandwidth is not available for making firewall rules.

------
vfulco2
I remain completely disgusted and confused why websites hosted on AWS S3 (in
BJ) by fully registered firms with valid ICPs are still banned. I have to use
10x the computing power that I need and I could load additional tools in its
place. That and the lack of AWS Amplify being offered really crushes
innovation here. (Shanghai based entrepreneur)

------
avinium
Has anyone registered an AWS China account without a Chinese company?

The application process requires you to select a Chinese city/postcode.

~~~
teknologist
China - opening to the world. At least that's what they say...

------
fungi
if there is anything remotely dynamic in your app go with option 2.

i've mainland proxied and cached the hell out of everything i can, warm the
caches daily, but once the user starts interacting (eg search) then hitting
our servers really bites randomly. usually not so bad for honkers server, but
even that route can randomly drop off the face of the planet.

~~~
fungi
hmm, option 3 looks interesting. i would need to test it to have confidence in
it (especially over problematic periods like golden week), but having your
server in honkers is a big plus over the other side.

------
klaudius
Does just having links on a page (e.g. Google Maps link or FB profile) cause
slow page load?

~~~
pcr0
If you're loading them asynchronously, no.

~~~
klaudius
On this page[1] it says that even links (e.g. Google Play links) might cause
slow page load time.

    
    
      [1] https://crossborder.digital/how-to-test-your-page-loading-speed-in-china/

~~~
nyuszika7h
It sounds like the person writing this article was forced to mention a "unique
feature" for each website and they basically just wrote the same thing worded
differently for the first three.

------
xfalcox
Any suggestions of services that help a company obtain the ICP License?

~~~
argd678
You need a local company entity in China, I don’t think they allow it to be
offered as a service. They want to know how to get in touch with you in
person.

------
europsucks
Is there a service where you can test the performance of your web site from
within China?

Edit: Google knows [https://geekflare.com/test-website-load-time-from-
china/](https://geekflare.com/test-website-load-time-from-china/)

------
fxfan
Can I use a separate ip address for requests from china somehow?

------
spectramax
I don't want to live in a world where the next superpower blocks websites as
they suit them, suppress freedom of speech and journalism, exploit prisoners,
religious segregation camps, employing social dystopian systems and is led by
unimpeachable, unchallenged leader who has elected himself with a 1000-0 vote
as perpetual president of the country.

It is sad to see that the rest of the world has to bend down to serve this
repressive state. I've been to China and the people there are the same as us -
I despise the party, not the people. The next generation that grows up there
will not have the perspective of what it means to live in a free democratic
country.

~~~
alexcnwy
the internet will become impossible to censor (for everyone - it’s already
easy for the rich to avoid censorship) when satellite connections become
cheaper / faster / more accessible

~~~
xfitm3
the problem isn't tech - its people.

~~~
alexcnwy
what do you mean?

------
tossawayonphine
of course my websites work in china. i get hitup dailey by suppliers.

------
taf2
Yeah no thanks.

------
realusername
Why bother? There's no internet in China anyway, whatever hacks you are going
to use, the result will be completely random at best and your website working
or not there is just a matter of luck.

Even the big IT companies can't make it work so why would you?

~~~
snaky
> There's no internet in China anyway

More than 40% of the world's e-commerce transactions currently take place in
China. The United States’ share of the market is 24%, down from 35% in 2005.

~~~
realusername
Yes, on their local Intranet.

~~~
est
> 40% of the world's e-commerce transactions currently take place in China

> on their local Intranet

As if AliExpress.com is non-exist outside China?

Many non-China websites are blocked in China.

Yet Chinese websites serves globally.

Think about it.

~~~
tjpnz
So it's an extranet then.

~~~
est
It's an Intranet for Chinese users, and western Webmasters.

