Publish: 2014-10-25 | Modify: 2014-12-09
From the beginning, I used Hong Kong virtual hosting, and then gradually started to explore VPS. Although I haven't used many hosting providers, I have experienced both free and paid ones. Recently, I moved my blog to DigitalOcean, which was quite a journey. DigitalOcean is a US-based cloud hosting provider, and its speed may be slightly slower than domestic providers. However, with some optimization, it is not much slower than domestic hosting providers. Here, I will share some optimization strategies based on what I have learned.
Usually, domain registrars provide free DNS resolution services. If you choose a smaller registrar or a foreign registrar, I personally do not recommend using their DNS resolution services directly. Smaller service providers may be unstable, and foreign service providers may be blocked. This is a very unfortunate situation, so you need to find a stable DNS service provider.
In China, there are many free DNS services available, such as DNSPOD, Aliyun DNS, Baidu Cloud Acceleration, etc. These are quite reliable as they are all large companies. However, when I used DNSPOD, I encountered DNS errors reported by Google Webmaster Tools. You can try using DNSPOD International Edition.
When the server is located overseas, the speed may be slower. If you also load many website files together, it will be even slower. However, you can store images, CSS, JS, and other static files on third-party platforms to achieve acceleration. WordPress users often use services like Qiniu Cloud Storage (10GB free), Upyun (which recently launched a free campaign), or Sina Weibo Image Host. These are all good options. I have been using Qiniu Cloud Storage for my blog.
The advantage of using third-party front-end libraries is that they have multiple CDN nodes, ensuring the fastest loading speed. In addition, when you visit a website that uses the same front-end library, the browser does not need to load it again, saving a lot of time. Chinese front-end libraries include Baidu, Sina, 360, Upyun, and Qiniu.
WordPress officially recommends a very good caching plugin called WP Super Cache. According to my tests, using this plugin can reduce response time by several hundred milliseconds and significantly improve Baidu Webmaster's speed score. However, it may be slightly difficult for beginners to use and may encounter some strange problems. I recommend using it for websites with a large number of articles or for those hosted on foreign servers.
It is a well-known principle for developers that CSS should be loaded first, and JS should be loaded last. Many websites use share buttons, and the common practice is to directly copy and paste the code. I suggest placing the code that calls the share buttons' JS at the bottom of the body.
I have been using CNZZ webmaster statistics tool, but I haven't found a good acceleration solution. During each test, I found that it did take some time. Recently, I switched to Baidu asynchronous statistics for webmaster statistics, which has also made a small improvement.
These are some strategies I have summarized based on my limited knowledge. They may not be the best, but they do have a certain effect on acceleration. If you have better methods, don't forget to share!
I come from China and I am a freelancer. I specialize in Linux operations, PHP, Golang, and front-end development. I have developed open-source projects such as Zdir, ImgURL, CCAA, and OneNav.