问题描述
我自己没有使用CDN,但我真的很好奇数据如何上传到他们.假设用户将图像上传到CDN Pop,该图像是否仅存储在该CDN Pop上?但是,如果是这样,如果用户离开并使用另一个CDN Pop,则该图像将不可用?
或者如果另一个用户想要该图像但该CDN Pop离她/他很远,该怎么办?
否则,需要将图像上传到数百个CDN pop上,这会占用大量带宽.因此,一个10kb的图像每月可能会占用您的可用带宽数十兆字节.
这对我来说意义不大.
有人可以清除吗?
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 ?
推荐答案
可以使用两种方法为大多数CDN提供数据:
There are two ways you can serve data from most CDNs:
- 使用提取区域:这将从原始服务器中提取现有内容并将其缓存在CDN的PoP上
- 使用推送区域::您将内容手动上传到CDN的存储集群,然后从那里将内容分发到CDN的PoP.
- 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.
要回答您的其他问题:
资产缓存基于访问者向其请求资产的位置.如果访问者在澳大利亚且CDN在澳大利亚具有PoP,则资产将被缓存在该位置.但是,如果另一个用户请求来自德国的请求,并且CDN在德国有服务器,则资产也将被缓存在德国.
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.
资产将始终从最近的可用PoP交付.如果PoP没有所请求的资产,它将请求服务器,然后缓存该资产,以便可以更快地将其交付给下一个请求者.
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.
要了解有关CDN的工作原理及其含义的更多信息,建议您通读本指南: https://www.keycdn.com/what-is-a-cdn
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
这篇关于如何将数据上传到CDN?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!