您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

什么是 Azure 上的内容分发网络?What is a content delivery network on Azure?

内容分发网络 (CDN) 是高效地向用户分发 Web 内容的分布式服务器网络。A content delivery network (CDN) is a distributed network of servers that can efficiently deliver web content to users. CDN 将缓存的内容存储在 接入点 (POP) 位置(靠近最终用户的边缘服务器),以最大程度地降低延迟。CDNs store cached content on edge servers in point-of-presence (POP) locations that are close to end users, to minimize latency.

Azure 内容分发网络 (CDN) 为开发人员提供了一个全局解决方案,通过在世界各地按特定策略放置的物理节点缓存内容来快速分发高带宽内容。Azure Content Delivery Network (CDN) offers developers a global solution for rapidly delivering high-bandwidth content to users by caching their content at strategically placed physical nodes across the world. Azure CDN 还可以通过 CDN POP 来利用各种网络优化措施,从而加速不能缓存的动态内容的交付。Azure CDN can also accelerate dynamic content, which cannot be cached, by leveraging various network optimizations using CDN POPs. 例如,可以绕过边界网关协议 (BGP) 的路由优化。For example, route optimization to bypass Border Gateway Protocol (BGP).

使用 Azure CDN 来交付网站资产的优点包括:The benefits of using Azure CDN to deliver web site assets include:

  • 为最终用户提供更好的性能和改进的用户体验,尤其是在使用的应用程序需要多次往返来加载内容时。Better performance and improved user experience for end users, especially when using applications in which multiple round-trips are required to load content.
  • 大幅度缩放以更好地处理瞬间的高负载,例如在产品发布活动开始时。Large scaling to better handle instantaneous high loads, such as the start of a product launch event.
  • 通过分发用户请求并直接通过边缘服务器来提供内容,可以减少发送到源服务器的流量。Distribution of user requests and serving of content directly from edge servers so that less traffic is sent to the origin server.

如需当前 CDN 节点位置的列表,请参阅 Azure CDN POP 位置For a list of current CDN node locations, see Azure CDN POP locations.

工作原理How it works

CDN 概述

  1. 用户 (Alice) 使用带有特殊域名(例如 <终结点名称> .azureedge.net)的 URL 来请求文件(也称资产)。A user (Alice) requests a file (also called an asset) by using a URL with a special domain name, such as <endpoint name>.azureedge.net. 此名称可以是终结点主机名,也可以是自定义域。This name can be an endpoint hostname or a custom domain. DNS 将请求路由到性能最佳的 POP 位置,该位置通常是在地理上最靠近用户的 POP。The DNS routes the request to the best performing POP location, which is usually the POP that is geographically closest to the user.

  2. 如果 POP 中的边缘服务器在其缓存中没有文件,则 POP 将从源服务器请求文件。If no edge servers in the POP have the file in their cache, the POP requests the file from the origin server. 源服务器可以是 Azure Web 应用、Azure 云服务、Azure 存储帐户或任何公开可用的 Web 服务器。The origin server can be an Azure Web App, Azure Cloud Service, Azure Storage account, or any publicly accessible web server.

  3. 源服务器将文件返回到 POP 中的边缘服务器。The origin server returns the file to an edge server in the POP.

  4. POP 中的边缘服务器缓存文件并将文件返回到原始请求者 (Alice)。An edge server in the POP caches the file and returns the file to the original requestor (Alice). 在通过 HTTP 标头指定的生存时间 (TTL) 过期之前,文件仍缓存在 POP 中的边缘服务器上。The file remains cached on the edge server in the POP until the time-to-live (TTL) specified by its HTTP headers expires. 如果源服务器未指定 TTL,默认 TTL 为 7 天。If the origin server didn't specify a TTL, the default TTL is seven days.

  5. 其他用户则可能会使用 Alice 使用的 URL 请求同一文件,也可能被引向同一 POP。Additional users can then request the same file by using the same URL that Alice used, and can also be directed to the same POP.

  6. 如果文件的 TTL 未过期,POP 边缘服务器会直接从缓存返回文件。If the TTL for the file hasn't expired, the POP edge server returns the file directly from the cache. 此过程会带来速度更快、响应更及时的用户体验。This process results in a faster, more responsive user experience.

要求Requirements

若要使用 Azure CDN,必须至少拥有一个 Azure 订阅。To use Azure CDN, you must own at least one Azure subscription. 还需创建至少一个 CDN 配置文件,该文件集合了 CDN 终结点。You also need to create at least one CDN profile, which is a collection of CDN endpoints. 每个 CDN 终结点表示对内容交付行为和访问权限的特定配置。Every CDN endpoint represents a specific configuration of content deliver behavior and access. 若要通过 Internet 域、Web 应用程序或某些其他条件来组织 CDN 终结点,可以使用多个配置文件。To organize your CDN endpoints by internet domain, web application, or some other criteria, you can use multiple profiles. 由于 Azure CDN 定价是在 CDN 配置文件级别应用的,因此如果需要使用混合的定价层,则必须创建多个 CDN 配置文件。Because Azure CDN pricing is applied at the CDN profile level, you must create multiple CDN profiles if you want to use a mix of pricing tiers. 有关 Azure CDN 计费结构的信息,请参阅了解 Azure CDN 计费For information about the Azure CDN billing structure, see Understanding Azure CDN billing.

限制Limitations

每个 Azure 订阅都对以下资源设置了默认限制:Each Azure subscription has default limits for the following resources:

  • 可以创建的 CDN 配置文件数。The number of CDN profiles that can be created.
  • 可以在 CDN 配置文件中创建的终结点的数量。The number of endpoints that can be created in a CDN profile.
  • 可以映射到终结点的自定义域的数量。The number of custom domains that can be mapped to an endpoint.

有关 CDN 订阅限制的详细信息,请参阅 CDN 限制For more information about CDN subscription limits, see CDN limits.

Azure CDN 功能Azure CDN features

Azure CDN 提供以下重要功能:Azure CDN offers the following key features:

如需每个 Azure CDN 产品支持的功能的完整列表,请参阅比较 Azure CDN 产品功能For a complete list of features that each Azure CDN product supports, see Compare Azure CDN product features.

后续步骤Next steps