Amazon CloudFront is a Content Delivery Network (CDN) on AWS Cloud. A content delivery network refers to geographically distributed servers to provide the faster response of content over the internet.

Amazon CloudFront是AWS Cloud上的内容交付网络(CDN) 。 内容交付网络是指地理上分散的服务器,用于通过Internet提供更快的内容响应。

The popularity of the content delivery network (CDN) grown up in recent times. Its ability to serve content faster makes it a good choice over making requests to the origin servers. These days the majority of web traffic is served through CDNs, including traffic from major internet service providers like Amazon, Facebook, and Netflix.

内容交付网络(CDN)的流行是最近发展起来的。 它更快地提供内容的能力使其成为对原始服务器发出请求的不错选择。 如今,大多数Web流量都是通过CDN提供的,包括来自主要互联网服务提供商(如Amazon,Facebook和Netflix)的流量。

Amazon CloudFront took the content delivery network (CDN) to another level. It has 166 points of presence (PoPs) across the world which is massively scaled and globally distributed.

Amazon CloudFront将内容交付网络(CDN)提升到了另一个层次。 它在全球范围内拥有166个存在点(PoP) ,已在全球范围内大规模部署。

什么是Amazon CloudFront? (What is Amazon CloudFront?)

Amazon CloudFront is a web service in AWS cloud that provides the content delivery network (CDN). Amazon has the worldwide network of data centers often known as edge locations. CloudFront delivers the static and dynamic content such as .js, .html, .css, .js and image files. CloudFront speeds up the distribution of the content.

Amazon CloudFront是AWS云中的Web服务,可提供内容交付网络(CDN)。 亚马逊拥有通常称为边缘位置的全球数据中心网络。 CloudFront交付静态和动态内容,例如.js,.html,.css,.js和图像文件。 CloudFront可以加速内容的分发。

So, how they do it?

那么,他们是怎么做到的呢?

If you have the idea of the content delivery network (CDN) then you must know how all this works. Let’s take an example of request – When a user requests a content that is being served with CloudFront, the user is routed to the nearest edge location which has very low latency (Latency is the time delay in request completion).

如果您有内容传送网络(CDN)的想法,那么您必须知道所有这些工作原理。 让我们以请求为例-当用户请求CloudFront所提供的内容时,该用户将被路由到具有非常低延迟(延迟是请求完成中的时间延迟)的最近边缘位置。

  • If the requested content is available at edge location with low latency, CloudFront delivers it quickly.如果请求的内容在边缘位置可用且延迟时间很短,则CloudFront会快速提供它。
  • If not then the content would be retrieved from the origin location (Amazon S3, Http Web Server etc.)如果不是,则将从原始位置( Amazon S3 ,Http Web Server等)中检索内容。

为什么选择Amazon CloudFront? (Why Amazon CloudFront?)

If you know the use cases of the content delivery network (CDN) then you know the importance of the CloudFront. AWS adds a few things on top of the traditional content delivery network. CloudFront is massively scaled which makes it reliable and popular among AWS users.

如果您知道内容交付网络(CDN)的用例,那么您就会知道CloudFront的重要性。 AWS在传统内容交付网络之上添加了一些内容。 CloudFront已大规模扩展,使其可靠并在AWS用户中广受欢迎。

1.安全性 (1. Security)

Amazon CloudFront is a highly secured content delivery network (CDN) provides both application and network level security. AWS Shield, AWS Web Application Firewall (WAF), and CloudFront create layered security with Amazon Route53.

Amazon CloudFront是一个高度安全的内容交付网络(CDN),可提供应用程序和网络级别的安全性。 AWS Shield,AWS Web应用程序防火墙(WAF)和CloudFront使用Amazon Route53创建分层的安全性。

These layers protect against multiple types of attacks including network and application layer DDoS attacks. DDoS is one of the very popular security attacks on a content delivery network (CDN). Please let me know in comments if you want to understand DDoS attacks and prevention in detail.

这些层可防御多种类型的攻击,包括网络和应用程序层DDoS攻击 。 DDoS是内容分发网络(CDN)上非常流行的安全攻击之一。 如果您想详细了解DDoS攻击和预防,请在评论中让我知道。

2.快速的性能 (2. Fast Performance)

The content delivery network (CDN) is primarily designed to provide fast performance. CloudFront’s nature to store data on edge location with very low latency makes it faster than any other CDN.

内容交付网络(CDN)的主要目的是提供快速的性能。 CloudFront以极低的延迟在边缘位置存储数据的性质使其比任何其他CDN都快。

Amazon CloudFront is running on the AWS network backbone. Which makes it highly efficient between CloudFront Edge locations and other AWS services, across regions and applications.

Amazon CloudFront在AWS网络主干上运行。 这使得跨区域和应用程序在CloudFront Edge位置和其他AWS服务之间实现高效。

3.全球可用性 (3. Global Availability)

As mentioned earlier CloudFront has 166 points of presence (PoPs) across the world which is massively scaled and globally distributed.

如前所述,CloudFront在全球范围内拥有166个在线服务点(PoP),这些服务点已大规模扩展并分布于全球。

Amazon CloudFront usually delivers content from the edge location rather than the original location of the content. CloudFront also allows you to set up multiple origins to enable redundancy in your backend architecture.

Amazon CloudFront通常从边缘位置而不是内容的原始位置交付内容。 CloudFront还允许您设置多个源,以在后端架构中实现冗余。

4.可编程和DevOps友好 (4. Programmable and DevOps Friendly)

AWS provides the API to connect for almost all of its service on the cloud. Amazon CloudFront provides developers with a full-featured API to create, configure and maintain your CloudFront distributions.

AWS提供了用于连接其几乎所有云服务的API。 Amazon CloudFront为开发人员提供了功能齐全的API,用于创建,配置和维护您的CloudFront发行版。

You can find the API documentation of the CloudFront here:

您可以在此处找到CloudFront的API文档:

https://docs.aws.amazon.com/cloudfront/latest/APIReference/Welcome.html

https://docs.aws.amazon.com/cloudfront/latest/APIReference/Welcome.html

5.具有成本效益 (5. Cost Effective)

Amazon CloudFront is a very cost-effective service on AWS. It also comes in the free tier as well, so, you need not pay if you are a beginner or tech enthusiast and just want to see how things work.

Amazon CloudFront是AWS上非常经济高效的服务。 它也提供免费服务,因此,如果您是初学者或技术爱好者,并且只想看看它是如何工作的,则无需付费。

Below is the cost model that AWS provides:

以下是AWS提供的成本模型:

Cloudfront Cost Model

Cloudfront成本模型

Note: If you are going to heavily use the CloudFront then you can also talk to the AWS team for the discount.

注意:如果您打算大量使用CloudFront,则还可以与AWS团队联系以获取折扣。

CloudFront如何工作? (How CloudFront Works?)

There are two aspects of Amazon CloudFront of how it works.? First is storing the content on edge location and replicating that to other edge location. Second, the retrieval of content from edge locations and from the origin location.

Amazon CloudFront的工作方式有两个方面。 首先是将内容存储在边缘位置,然后将其复制到其他边缘位置。 第二,从边缘位置和原始位置检索内容。

1.设置CloudFront以交付内容 (1. Setup CloudFront to deliver content)

You create a CloudFront distribution with the origin where you want to store the static and dynamic content like .js, .html, .css, and images. The origin of content could be an Amazon S3 bucket or an Http Web server.

您创建一个CloudFront分布,其原始位置是您想要存储静态和动态内容(如.js,.html,.css和图像)的位置。 内容的来源可能是Amazon S3存储桶或Http Web服务器。

Amazon CloudFront sends the content to its edge locations ie. edge servers. Let’s see how to configure your CloudFront:

Amazon CloudFront将内容发送到其边缘位置,即 边缘服务器。 让我们看看如何配置CloudFront:

  • Origin Server: Specify the origin server of location of the content.源服务器:指定内容位置的源服务器。
  • Upload Content to Origin: Now, upload files to your origin server. Files also known as objects, typically includes web pages, images, and media files, can be anything that can be served over HTTP (No other than HTTP complaint content).将内容上传到原始服务器现在,将文件上传到原始服务器。 文件也称为对象,通常包括网页,图像和媒体文件,可以是可以通过HTTP提供的任何文件(HTTP投诉内容除外)。
  • Create CloudFront Distribution: Create CloudFront distribution to specify the content origin location. The origin will be used to get your files from when users request the files through your web site or application创建CloudFront分配:创建CloudFront分配以指定内容来源位置。 当用户通过您的网站或应用程序请求文件时,原点将用于获取文件
  • Domain Creation: CloudFront will assign a domain for your new distribution that you will be using in place of origin url.域创建: CloudFront将为您要使用的新发行版分配一个域,以代替原始URL。
  • Distribution Configurations: Once the CloudFront distribution has been created, CloudFront will send the distribution configurations to all of its edge locations. CloudFront caches will cache the objects.分发配置:创建CloudFront分发后,CloudFront会将分发配置发送到其所有边缘位置。 CloudFront缓存将缓存对象。

Please see the below diagram to understand the CloudFront request flow (Source: Amazon Web Service):

请参阅下图以了解CloudFront请求流程(来源:Amazon Web Service):

Cloudfront Request Flow

Cloudfront请求流程

2. CloudFront如何交付内容? (2. How CloudFront delivers content?)

After configuring your CloudFront distribution you can use the CloudFront URL for the content delivery.

配置CloudFront分配后,您可以使用CloudFront URL进行内容交付。

  • A user access the content or requests to a website page用户访问内容或请求访问网站页面
  • Domain name server (DNS) routes your request to the CloudFront edge location that is nearest in terms of latency域名服务器(DNS)将您的请求路由到就延迟而言最近的CloudFront边缘位置
  • In the edge location, the CloudFront checks the cache for the requested content. If the content available then returns else it follows:
    • CloudFront sends the request to the origin server
    • The origin server retrieves the image and sends it back to the CloudFront edge location.
    • The origin server retrieves the image and sends it back to the CloudFront edge location. CloudFront also adds the files to the cache in the edge location for the next time someone requests those files.

    在边缘位置,CloudFront会在缓存中检查请求的内容。 如果内容可用,则返回其他内容:

    • CloudFront将请求发送到原始服务器
    • 原始服务器检索图像并将其发送回CloudFront边缘位置。
    • 原始服务器检索图像并将其发送回CloudFront边缘位置。 CloudFront还会在下次有人请求这些文件时将文件添加到边缘位置的缓存中。

Amazon CloudFront用例 (Amazon CloudFront Use Cases)

There are several use cases of CloudFront, especially wherever the website acceleration is required. As we know that CloudFront is the content delivery network so all the applications of CDN are also the use cases of the CloudFront.

CloudFront有多种使用案例,尤其是在需要网站加速的地方。 我们知道CloudFront是内容交付网络,因此CDN的所有应用程序也是CloudFront的用例。

Below are the few of many use cases of CloudFront on AWS:

以下是AWS上CloudFront的许多用例中的几个:

1.直播视频 (1. Live Streaming Videos)

CloudFront offers many options to stream your videos faster which includes both stored videos as well as the live videos or events.

CloudFront提供了许多选项,可以更快地流式传输视频,其中包括存储的视频以及实时视频或事件。

Amazon CloudFront streams in all common formats such as MPEG DASH, Apple HLS, Microsoft Smooth Streaming, and CMAF, to any device.

Amazon CloudFront以所有常见格式(例如MPEG DASH,Apple HLS,Microsoft Smooth Streaming和CMAF)流式传输到任何设备。

2.加快网站内容 (2. Accelerate Website Content)

CloudFront can drastically improve the performance of your website content by caching the content. It reduces the steps to reach to your data since its cache mechanism holds the content data at edge location.

CloudFront可以通过缓存内容来极大地提高网站内容的性能。 由于其缓存机制将内容数据保留在边缘位置,因此减少了访问数据的步骤。

To simply demonstrate how things work:

为了简单地演示事情的工作原理:

Request Flow Of Cloud Formation

请求云流

This is very popular among the AWS users that Amazon S3 + Amazon CloudFront: A Match made in Cloud.

Amazon S3 + Amazon CloudFront:在云中进行匹配的AWS用户中,这非常受欢迎。

3.在边缘定制 (3. Customize at the Edge)

CloudFront opens up a number of possibilities when you run the serverless code like Amazon Lambda functions. For Example, You can configure a number of error messages and specific content in the response of the errors. Or you can use a function to help authorize users and control access to your content before CloudFront forwards a request to your origin.

当您运行无服务器代码(如Amazon Lambda函数)时,CloudFront带来了许多可能性。 例如,您可以在错误响应中配置许多错误消息和特定内容。 或者,您可以使用函数在CloudFront将请求转发到您的来源之前帮助授权用户并控制对您内容的访问。

In our next post, we will talk more about the CloudFront setup with Amazon S3 with a static website.

在我们的下一篇文章中,我们将更多地讨论带有静态网站的Amazon S3的CloudFront设置。

翻译自: https://www.journaldev.com/27253/amazon-cloudfront

亚马逊CloudFront相关推荐

  1. 亚马逊CloudFront隐藏源站域名设置

    出于安全方面的考虑,有时我们希望对客户端隐藏服务器的域名或IP地址,这时可以利用亚马逊CloudFront服务来实现. (1)Origins设置页中的Origin Protocol Policy选择& ...

  2. 亚马逊aws深度学习_AWS速查表:Amazon Web Services入门时首先要学习的5件事

    亚马逊aws深度学习 AWS has taken the tech community by storm. It's easily sold as one of the most reliable p ...

  3. 亚马逊aws服务取消_亚马逊网络服务(AWS)

    亚马逊aws服务取消 Amazon Web Services (AWS) has been much a talk since more than a decade. The credit goes ...

  4. 通过亚马逊云科技实现基于 Restful API 的 CloudFront Distribution 复制/克隆功能

    背景 Amazon CloudFront 是一个全球性的内容分发网络 (CDN),您可以借助 CloudFront 以低延迟和高可用性向查看者或者最终用户分发内容.通常来讲,Amazon CloudF ...

  5. 亚马逊云AWS的cloudfront配置,跟国内阿里云的CDN相比,有一个大坑

    在亚马逊云AWS上,CDN的服务名称叫CloudFront,跟国内CDN的叫法略有不一样,但整体用法都差不多. 首先创建完一个CDN实例,填写一些简单的信息 然后选择S3存储的数据源,作为CDN缓存的 ...

  6. 亚马逊AWS在线系列讲座——基于AWS云平台的高可用应用设计

    设计高可用的应用是架构师的一个重要目标,可是基于云计算平台设计高可用应用与基于传统平台的设计有很多不同.云计算在给架构师带来了很多新的设计挑战的时候,也给带来了很多新的设计理念和可用的服务.怎样在设计 ...

  7. 亚马逊 各国站点 链接_使用Amazon S3和HTTPS的简单站点托管

    亚马逊 各国站点 链接 by Georgia Nola 乔治亚·诺拉(Georgia Nola) 使用Amazon S3和HTTPS的简单站点托管 (Simple site hosting with ...

  8. 编程语言“鄙视链” +1?亚马逊力捧 Rust,Go 技术负责人连发 14 条推特抵制“拉踩”

    整理 | 郑丽媛 出品 | CSDN(ID:CSDNnews) 每个领域总有一些说不清道不明的"鄙视链",在程序员圈中尤是如此.从编程语言.编辑器.工具,到浏览器.服务器系统,甚至 ...

  9. 编程语言“鄙视链” +1?亚马逊力捧 Rust,Go 技术负责人连发 14 条推特抵制“拉踩”...

    整理 | 郑丽媛 出品 | CSDN(ID:CSDNnews) 每个领域总有一些说不清道不明的"鄙视链",在程序员圈中尤是如此.从编程语言.编辑器.工具,到浏览器.服务器系统,甚至 ...

最新文章

  1. 2.2基本算法之递归和自调用函数_你为什么学不会递归?读完这篇文章轻松理解递归算法...
  2. 反激qr工作原理_锂电池均衡电路的工作原理
  3. MATLAB应用实战系列(四十四)-基于matlab的支持向量机分类、回归问题(附源码解析)
  4. oracle学习笔记三
  5. 一轮项目冲刺——移山小分队(6)
  6. pdf转txt出现句子异常中断,如何连接被切断的字符串
  7. MyEclipse或Eclipse导出JavaDoc中文乱码问题解决
  8. AttributeError: ‘_IncompatibleKeys‘ object has no attribute ‘cuda‘
  9. VS2010下配置 OpenCV2.2
  10. 新中国成立60周年重要科技成果知识竞赛试题
  11. python建模预测_如何使用Python进行节目观众数的线性回归预测
  12. 两种模式的资源管理器代码之———— 重命名文件夹
  13. 矩阵转置与矩阵对称性的关系
  14. 如果看了此文你还不懂傅里叶变换,那就过来掐死我吧【完整版】
  15. 实现导航栏的几种方式
  16. Java项目:体育用品商城(java+SpringBoot+jsp+html+maven+mysql)
  17. 安装mysql忘记设置密码后如何重设密码
  18. ubuntu 安装微信(微信官方版本)
  19. Buffon投针实验:究竟为什么是pi?
  20. 永强教你加解密:对称篇(一)

热门文章

  1. 九度OJ 1193:矩阵转置 (矩阵计算)
  2. Linux FastDFS 分布式文件系统安装
  3. [转载] python创建集合set()_Python 集合set()
  4. 基于SOC方案的嵌入式开发-远程定时设备
  5. Python返回多个值
  6. 第三十一篇 玩转数据结构——并查集(Union Find)
  7. 原型设计应当掌握的四个设计思维:初始、常态、边界、错误
  8. 使用Block在两个界面之间传值
  9. (四)最邻近插值、双线性插值
  10. yolov3从头实现(四)-- darknet53网络tf.keras搭建