大网数据广告活动
网站运营与故障问答

Why should I use CDN when 97% of my traffic is from one country?

· 52CE 我爱测

I'm surprised many people highly recommend CDN! I'm dealing with an online store where 97% of its website traffic comes from one country, which considering the cost incurred shows that this site does not need a CDN. Do you think …

问题原文

原帖链接 · saeed arab sheybani · CC BY-SA 4.0

I'm surprised many people highly recommend CDN!

I'm dealing with an online store where 97% of its website traffic comes from one country, which considering the cost incurred shows that this site does not need a CDN. Do you think like me?

My question is whether or not to use a CDN in this situation

已采纳解答

原帖链接 · davidgo · CC BY-SA 4.0

The value of a CDN is use case dependent. As others have mentioned, a CDN can have benefits, but its not magic. In some edge cases it can actually slow things down - particularly if your server and client base are in the same geographic location, but the CDN isn't.

If you have fast, cheap traffic to your client base and your server can handle the loads, and you are not a target of DoS attacks and don't need to worry about uptime if you are suddenly targeted, you probably don't need a CDN.

Updated answer based on IRAN per comments

If you only care about people in your country, and the CDN is NOT in your country, you are likely better off NOT using a CDN. (As an outsider, reading relatively simplistic articles about Internet in Iran), I expect you would be better off taking steps to make your site better able to perform when within the governments framework, and I surmise the following may help -

  • Ensure you have Aggressive caching of images and static content and make sure they are as small as possible (so it is less likely to be downloaded during government mandated slowdowns).

  • Keep your dynamic content as lightweight as possible, seperating dynamic content from static content (eg CSS) as much as possible, and using well known, heavily cached libraries where useful (eg standard jquery with CSS linked from Google)

  • If you do go for a CDN, I believe there are only 2 in Iran, and I would not use one outside Iran (ie ArvanCloud and CDNvideo).

  • Without knowing much about the Internet layout of Iran, it might be worth running at least 2 sites in different provinces and making careful use of DNS (and controlling your DNS servers on the same networks as the 2 sites) to balance traffic if that's possible - certainly easier said then done with dynamic content. The idea being that very often slowdowns/blocks are partial or on major paths - by diversifying you can reduce the reliance on major paths. You also can attain many of the reliability benefits by having 2 sites - IF you can manage the complexity. (One way to partially do this may be to run your own caching reverse proxies - ie roll out your own mini CDN)

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2021-12-29)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。