视频上传到cdn java,如何将数据上传到CDN?

I didn't use a cdn myself but I'm really curious on how data gets uploaded to them. Suppose a user uploads an image to a cdn pop, is that image stored only on that one cdn pop? But if so if user moves away and uses another cdn pop the image will not be availble?

Or what if another user wants that image but that cdn pop is far away from her/him?

Otherwise the image needs to be uploaded on hundreds of cdn pops, which takes lot of bandwidth. Thus an image of 10kb could take tens of megabytes of your available bandwidth/month.

This doesn't make lots of sense to me.

Can anybody clear this up ?

解决方案

There are two ways you can serve data from most CDNs:

Using a pull zone: This pulls existing content from your origin server and caches it on the CDN's PoPs

Using a push zone: You manually upload content to the CDNs storage cluster and from there the content gets distributed to the CDN's PoPs.

To answer your other questions:

Asset caching is based on where the visitor is requesting the asset from. If the visitor is in Australia and the CDN has a PoP in Australia then the asset will be cached there. However, if another user requests the same as from Germany, and the CDN has a server in Germany then the asset will be cached there as well.

The asset will always be delivered from the nearest available PoP. If the PoP doesn't have the requested asset, it will ask the server and then cache the asset so that it can be delivered faster to the next requester.

To learn more about how CDNs work and what they entail, I'd recommend taking a read through this guide: https://www.keycdn.com/what-is-a-cdn

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值