Why CDN speed isn't the same worldwide?

I have a site at muhymin.com. The site is hosted in the USA. I’m using Cloudflare free CDN to reduce page loading times. But I’m seeing that the page loading times aren’t the same everywhere.

I am using GTMetrix for the test.

The page loading time in Canada is the fastest.

The page loading time in the USA & China is also fast.

But the page loading time in Brazil, India, Australia & UK is not so fast. And sometimes the loading exceeds 5s.
Screenshot (109)

The issue is simple, when you request the website from the opposite side of the world it still needs to go to the origin in the USA to retrieve the content. That takes time. If the website is subsequently cached (with the correct configuration of headers) then the next requests for the same assets will be served locally by the edge.

At a certain poi these assets will be evicted from the cache if not used and the process starts again. Storage on the edge nodes isn’t infinite…

Sorry for my little knowledge. But why the requests need to go to the origin when CDN is enabled?
And also why the fastest speed is in Canada instead of USA?

Because the CDN nodes don’t have the data, Cloudflare is technically a caching proxy, not a CDN per the normal definition. If you want the assets distributed distribute the origin or use an actual CDN (a push CDN) where you pay per GB stored and the bandwidth.

The fastest location depends on a ton factors: what is the saturation of the link between the test location and Cloudflare? Where some files already in the cache? Etc.


Thank you matteo for this informations.
But is Cloudflare really not a CDN?

It’s a complex answer, it’s a pull CDN, which is different from a push CDN. It serves different purposes to different users, some don’t even actually care if it’s a CDN, they use it for the security features, some use it to reduce load on the origin. It’s a CDN, just not exactly the type you expected.

1 Like

Thank you again matteo. I do care about Cloudflare being a CDN. I need Cloudflare more as a CDN.
Can you explain what is the difference between a ‘Push’ & ‘Pull’ CDN?

Way easier to link to other long form articles.


1 Like

Thank you very much matteo. These articles have made it easier for me to understand the differences. Thank you again.

I have found out that the first person to send a request to a new CDN location will find it hasn’t yet pulled that information and cached it ready for viewing. Making their experience seem no different from a site without CDN enabled.

But, I see that the speed slows down again after some time or a day even after the first one visits the website.

How can I prolong this interval? It doesn’t matter if the interval is one day. But it matters if the interval is just some minutes.

It’s rare for it to be some minutes, but no one can guarantee that. The thing you can do is optimize them so that when they are downloaded they are smaller and put long cache headers, they are not always respected, but maybe they stay there more.

Alternatively you could probably upgrade the plan, as I presume the higher the plan the higher the priority (not totally confirmed, maybe ask support).

1 Like

I do not know HTML codes. How can I put long cache headers?
I also have another question. What do you think, how long is the interval normally?

Those are questions that depend on so many factors outside the scope of this community i can’t even begin to reply. What server do you use? What software do you have on it? What content is the page serving? What type of resources? Those need to be checked and re-checked. Either hire someone or go to a more specific forum.

PS: the headers have nothing to do with HTML.

This topic was automatically closed after 30 days. New replies are no longer allowed.