Internet · August 3, 2020 2

Fixed An Issue Existed Nearly 2 Years

In the past 2 years I was told many times by friends who lived outside mainland China that he can not see some photos on my blog. However, it did not draw my attention until today. I thought that was caused by international internet problem at first. It came to my mind when I optimize another blog’s thumbnail images, the problem caused by the 2 different CDN I settle up for my blog.

It should not be a problem that you use several different CDN service for your blog. The question is I configured Upyun CDN for mainland China and Cloudfalre for the rest of the world. Upyun CDN offers online image optimize service which helps generate thumbnail images on its edge server instead of on my own server. This function helps me save my server cost and bandwidth. (Bandwidth in mainland China is very expensive.)

Upyun CDN optimize the images where you add a delimiter to the end of images’ url. So I modified some theme files of my blog to enjoy the service offered by Upyun CDN. However, Cloudflare does not support this feature. And this resulted that when users from outside mainland China visits the thumbnail images, Cloudfalre could not server the correct image.

When I noticed this issue, I was meant to remove Cloudflare service and serve all the users via Upyun CDN. It is fast and convenient. However, as you know the bandwidth in mainland China is expensive, serve all the traffic via Upyun CDN will cost me a lot, that’s not good.

I also remember that Xiaoshi used to configured 2 CDNs a layer by another. So I tried to configure Cloudflare as CDN still, but configure the Upyun CDN as my source server instead of real server. And then configure Cloudflare to cache everything and ignore dynamic enquire. After testing it, everything is fine. Now, users from all over the world can visit thumbnail image fast and secure.