TLDR; This Surge.sh China article provides you with a simple solution to get your Surge.sh powered websites fast, stable, and compliant in China.
What is Surge.sh?
Surge.sh is a command line (CLI) tool that provides service to host static sites.
Does Surge.sh Work in China?
No. Although Surge.sh is not blocked in China, Surge.sh has no servers in mainland China. As a result, Surge.sh is unstable and slow for users in China as we’ll see below.
Comparison Chart Before and After Speed Increase
It can be seen that the access speed of the sites deployed on Surge.sh in China is very unsatisfactory (left picture), and most areas are very slow (orange).
After speeding up, the result has reached a usable level (the dark green provinces with more on the right)
Source Code of the Test project
We chose a Hexo Blog as the test object. The default template was used, and no additional changes were made.
How to Improve the Access Speed of Surge.sh in China?
Surge.sh does not support the function of online construction (packaging). You can store static sites in the storage space of domestic cloud service providers after packaging locally, such as AWS China S3 or Aliyun’s OSS, basically Ensure the access speed of the website.
The disadvantages of deploying in the storage space are also very obvious: there are more initial configurations, if you want to make continuous deployment (Git push automatic packaging and deployment), you need more configuration.
If you want a hassle free solution in China that is as simple as Surge.sh and supports online packaging, you can host your site with 21YunBox.
Process of Hosting Static Sites with 21YunBox
1. Signup on 21YunBox
2. Authorize 21YunBox to access the code repository you want to deploy
3. Configure Build (Package) Command and Publish directory
4. Click “Create”
In moments, your site is packaged and deployed online.
You can access your project at app_id.21cloudbox.com
(app_id
is created and defined).
If you are not sure how to set up, please watch the step by step example video below:
What else can 21YunBox Deploy?
Like a back-end application framework Python Django or PHP Laravel. This is notoriously complicated to deploy. The 21YunBox also allows you to complete the package and go online to generate a unique second-level domain name in 3 or 4 minutes.
What else? Want to know more? You can check out How to use 21YunBox