What does it mean to distribute content with low latency and high data transfer speeds in Cloudfront?

Asked

Viewed 139 times

3

I saw in a website, the Cloudfront, and it seems to me that the site gets faster because of this.

I read about it:

"Amazon Cloudfront is a web service that gives businesses and app developers an easy and low-cost way to distribute content with low latency and high data transfer speeds."

All right, I kind of got it, but I’d like to understand better, what it would be distribute content with low latency and high data transfer speeds?

The aforementioned site, for example uses this in the images, if you take the link of the images for example, you will see.

Show 5 more comments

3 answers

3


Cloudfront

The Amazon Cloudfront is a global content delivery (CDN) network that securely delivers data, videos, apps, and Apis to viewers, low latency and high transfer speeds.

Recommended reading: What is CDN and how to enable it in my Javascript files?.

The Cloudfront is integrated with Amazon Web Service (AWS) on two levels:

  • Physical locations, which are directly connected to AWS’s global infrastructure;
  • And the software, which works directly with services such as AWS Shield for mitigating Ddos, Amazon S3, Elastic Load Balancing or Amazon EC2 as origins for applications and AWS Lambda for executing custom code near viewers.

Recommended reading: Amazon Web Service

What it means to distribute content with low latency and high data transfer speeds in Cloudfront?

According to the very definition contained in amazon website:

THE AWS Cloudfront, accelerates the delivery of static content (e.g., images, style sheets, Javascript, etc.), as it offers a multilayered cache with presence of regional caches that reduce latency and server load source when the object is not yet in the presence point cache;

According to Amazon itself, there are 44 availability zones in 16 geographic regions ... and more 82 presence points and 11 regional cache presence points in 23 countries and 49 cities, ensuring that applications provide high availability, scalability and performance.

The caching of static content provides the performance and scale needed to deliver a fast and reliable experience to viewers when visiting your website.

Also commented on the official website, Amazon says its intelligent routing of Cloudfront which is based on real-world latency measures, collected at all times along with hundreds of end-user Internet service providers and AWS backbone network usage, allows you to accelerate end-to-end content delivery.


It is worth noting that the main, to ensure content distribution with low latency and high data transfer speeds is the presence of regional cache.

1

This answer came before editing the question, I will edit or remove, I am still analyzing if it is possible to save something

The link explains how the behavior between servers works:

But what I understand by your question is that you might want to know how to set up, as this link Basics of Cloudfront

Basics of Cloudfront

The example of this topic provides a quick overview of how to use Cloudfront for:

Store original versions of your objects in an Amazon Simple Storage Service (Amazon S3) Bucket. Distribute the download of content such as text or graphics. Make your objects accessible to everyone. Use the Cloudfront domain name in Urls for your objects (for example, http://d111111abcdef8.cloudfront.net/image.jpg), instead of your own domain name (for example, http://www.example.com/image.jpg). Keep your objects at Cloudfront points of presence for the standard 24-hour duration. (The minimum duration is 0 seconds.) For information on using Cloudfront when you want to use other options, see To-do list to create a web distribution or To-do list for files using RTMP Streaming Media.

You just need to perform a few basic steps to start delivering your content using Cloudfront. The first step is to sign up. After that, you create a Cloudfront distribution and then use the Cloudfront domain name to reference the content on your web pages or apps.

Step 1: Sign up for Amazon Web Services

If you haven’t already done so, register for Amazon Web Services at http://aws.amazon.com. Just choose Sign Up Now and enter all necessary information.

Step 2: Upload your content to Amazon S3 and grant object permissions

An Amazon S3 Bucket is a container that can contain objects or folders. Cloudfront can distribute almost any type of object to you using an Amazon S3 Bucket as the source, for example, text, images and videos. You can create multiple Buckets, and there is no limit to the amount of data you can store on Amazon S3.

By default, the Amazon S3 Bucket and all its objects are private - only the AWS account that created the Bucket is allowed to read or write the objects. If you want to allow anyone to access objects in the Amazon S3 Bucket using public Cloudfront Urls, you must grant read permissions for the objects. (This is one of the most common Cloudfront bugs and when working with Amazon S3. You must explicitly grant privileges to each object in an Amazon S3 Bucket.)

note If you want to restrict who can download your content, you can use Cloudfront’s private content feature. For more information on the distribution of private content, see Distributing private content through Cloudfront. To upload your content to Amazon S3 and grant permission reading for all

Log in to the AWS Management Console and open the Amazon S3 console on https://console.aws.amazon.com/s3/.

On the Amazon S3 console, choose Create Bucket.

In the Create Bucket dialog box, enter a Bucket name.

Important For your Bucket to work with Cloudfront, the name must be in accordance with DNS naming requirements. For more information, see Bucket Restrictions and Limitations in the Amazon Simple Storage Service Developer’s Guide. Select a region for your Bucket. By default, Amazon S3 creates Buckets in the Eastern US (Northern Virginia). We recommend that you choose a region near you to optimize latency, minimize costs, or meet regulatory requirements.

Escolha Create.

Select your Bucket in the Buckets panel and choose Upload.

On Upload - Select Files page, choose Add Fileif you choose the files you want to upload.

inserir a descrição da imagem aqui

Enable public read privileges for each object you send to your Amazon S3 Bucket.

Escolha Set Details.

On Set Details page, choose Set Permissions.

On Set Permissions page, choose Make Everything public.

Choose Start Upload.

After the upload is complete, you can navigate to this item to its URL. In the case of the previous example, the URL would be:

http://s3.amazonaws.com/example-myawsbucket/filename

Use the Amazon S3 URL to verify that your content is publicly accessible, but remember that this is not the URL used when you’re ready to distribute your content.

Step 3: Create a Cloudfront web distribution

To create a Cloudfront web distribution

Open the Cloudfront console on https://console.aws.amazon.com/cloudfront/.

Escolha Create Distribution.

On the Select a delivery method for your content page, in the Web section, choose Get Started.

inserir a descrição da imagem aqui

On the Create Distribution page, under Origin Settings, choose the Amazon S3 Bucket you previously created. For Origin ID, Origin Path, Restrict Bucket Accesse Origin Custom Headers, accept default values.

Especifique o bucket do Amazon S3.

In Default Cache Behavior Settings, accept the default values and Cloudfront will be:

Forward all requests that use the Cloudfront URL to your distribution (for example, http://d111111abcdef8.cloudfront.net/image.jpg) for the S3 Amazon Bucket you specified in Step 4. Allow end users to use HTTP or HTTPS to access their objects. Respond to requests from your objects. your cached objects the Cloudfront presence points for 24 hours. Forward only the standard request headers to their source and not caching objects based on header values. Delete cookies and query character sequence parameters, if any, when forwarding object requests to their source. (Amazon S3 does not process cookies and processes only a limited set of query character sequence parameters.) Do not be configured to distribute media files in Microsoft Smooth Streaming format. Allow anyone to view your content. Do not automatically compress your content. For more information about cache behavior options, see Cache behavior settings.

Definir comportamento de cache.

Under Distribution Settings, enter the applicable values:

Price class Select the price class that matches the maximum price you want to pay per Cloudfront service. By default, Cloudfront offers its objects from points of presence in all Cloudfront regions.

For more information about price classes and how your choice of price class affects Cloudfront’s performance for your distribution, go to Choose the price class for a Cloudfront distribution. For information on Cloudfront price setting, including how to map price classes to Cloudfront regions, go to Amazon Cloudfront price.

AWS WAF ACL Web If you want to use AWS WAF to allow or block HTTP and HTTPS requests based on criteria you specify, choose the web ACL to associate with that distribution. For more information about AWS WAF WAF by AWS, see the Developer’s Guide.

Switch domain names (Cnames) (Optional) Specify one or more domain names you want to use for Urls for your objects instead of the domain name it assigns when you create your distribution. For example, if you want the URL to the object:

/images/image.jpg

to the following:

http://www.example.com/images/image.jpg

instead of:

http://d111111abcdef8.cloudfront.net/images/image.jpg

you must create a CNAME for www.example.com.

Important If you add a CNAME to www.example.with your distribution, you also need to create (or update) a CNAME record with the DNS service to route the queries to www.example.with the d111111abcdef8.cloudfront.net. You must be allowed to create a CNAME record with the DNS service provider for the domain. Normally, this means that you own the domain, but you can also be developing an application for the proprietary domain. For more information about Cnames, see Using Alternate Domain Names (Cnames). To learn more about the limit on the number of alternate domain names you can add to a distribution, see Amazon Cloudfront Limits in the Amazon Web Services General Reference. To request a higher limit, go to https://console.aws.amazon.com/support/home#/case/create? issueType=service-limit-increase&limitType=service-code-cloudfront-distributions.

SSL certificate Accept default value, Default Cloudfront Certificate.

Default root object (Optional) The object you want the Cloudfront request from its source (e.g., index.html) when a viewer requests the root URL of its distribution (http://www.example.com/) instead of an object in its distribution (http://www.example.com/product-description.html). Specifying a standard root object avoids exposing the content of your distribution.

Logging (Optional) If you want Cloudfront to record information about each request for an object and store the log files in an Amazon S3 Bucket, select One specify the Bucket and an optional prefix for the log file names. There is no additional cost to enable logging, but you provision usual Amazon S3 charges to store and access the files. Cloudfront does not delete the logs automatically, but you can delete them at any time.

Cookie log In this example, we are using Amazon S3 as the source of your objects and Amazon S3 does not process cookies, so we recommend that you select Off for the Logging Cookie value.

Comment (Optional) Enter the comments you want to save with the distribution.

Distribution state Select this Enabled option if you want requests to start processing Cloudfront as soon as the distribution is created, or select Disabled if you do not want requests to start processing Cloudfront after the distribution is created.

configuraçõesdedistribuição

Escolha Create Distribution.

After you have created your Cloudfront distribution, the value of the Status column for your distribution will be changed from Inprogress to Deployed. If you choose to enable the distribution, it will then be ready to process requests. This should take less than 15 minutes.

The domain name you assign to your Cloudfront distribution appears in the list of distributions. (It is also displayed in the General tab for a selected distribution.)

Step 4: Test Your Links

After creating the distribution, it knows where the source server is Amazon S3 and you know the domain name associated with the distribution. You can create a link to your Amazon S3 content Bucket with that domain name and make it serve.

note: You should wait until the status of your distribution changes deployed before testing your links.

To link your objects

Copy the following HTML into a new file:

Replace name with the domain name you assigned to your Cloudfront distribution. Replace the name with the name of a file in your Amazon S3 Bucket. Copy

<html>
<head>My CloudFront Test</head>
<body>
<p>My text content goes here.</p>
<p><img src="http://domain name/object name" alt="my test image"/>
</body>
</html>

For example, if your domain name d111111abcdef8.cloudfront.net and its object was image.jpg, the link URL would be:

 http://d111111abcdef8.cloudfront.net/image.jpg.

If the object is in a folder in your Bucket, they include the folder in the URL. For example, if image.jpg is located in an image folder, then the URL would be:

 http://d111111abcdef8.cloudfront.net/images/image.jpg

Save the text to a file that has a.html file name extension..

Open the web page in a browser to ensure that you can see its content. If you can’t see the content, confirm that you have performed all the steps correctly. You can also see the tips in Troubleshooting.

The browser returns the page with the embedded image file, provided presence of the determined Cloudfront was appropriate to serve the object.

I’m still adjusting the markup, I copied the text and it was automatically translated

  • I edited it to try mislead the question as discussed in the comments. To my mind I believe that an edition (feel free to do/reverse) could 'save' your answer more because it was very well developed.

  • And I also believe that there is no problem in maintaining it, since it makes a whole tutorial for use of the initial Cloudfront.

  • @Uzumakiartanis seems like a good idea.

0

Cloudfront simply takes the content from the Source Server and distributes it to several Points of Presence around the world on top of the Amazom network. From there, when the user does the access is routed to the Point of Presence that is closest to him. Since this distance is usually less than going to the Source Server to fetch the data, the latency is lower. Remembering that latency is the round-trip time, ie how long it takes for the request to exit your computer, hit the server and return to your computer.

Hugs,

Airton


devcontent.com.br

Browser other questions tagged

You are not signed in. Login or sign up in order to post.