AWS launched its CDN service cloudfront several years ago, allowing you to create a URL pointing to your own S3 bucket or web server. When others access this cloudfront URL, the DNS will automatically resolve the Edge server to the nearest physical location, and then the Edge server will query whether there is any related cache, if not, he will send a request to orgin for information and keep it in the local area. The default cache time is 24 hours.
For detailed work process, refer to the following link
Http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/HowCloudFrontWorks.html
First, create an S3 bucket named beanphoto, and set region to sysydney.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/42/A1/wKiom1PYmCHBLaScAAA9RJIjkqU124.png "style =" float: none; "Title =" 1.png" alt = "wkiom1pymchblascaaa9rjijkqu124.png"/>
Then upload an image.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/42/A1/wKioL1PYmT3DMSdhAABDNoDM9Cg947.png "style =" float: none; "Title =" 2.png" alt = "wkiol1pymt3dmsdhaabdnodm9cg947.png"/>
To ensure that all users can access the service from the cloudfront URL, you must set it to public.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/42/A1/wKiom1PYmCWzT0wwAAA2bu0zeE4184.png "style =" float: none; "Title =" 3.png" alt = "wkiom1pymcwzt0wwaaa2bu0zee4184.png"/>
First, check whether the S3 bucket link is working.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/42/A1/wKioL1PYmT_igylbAAA1WbpTOl8918.png "style =" float: none; "Title =" 4.png" alt = "wkiol1pymt_igylbaaa1wbptol8918.png"/>
There is a problem opening the wood. Nice scenery. This is a photo of beans taken on a small island in Fiji.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/42/A1/wKiom1PYmDeTX8jRAAPZupTiIFo622.png "style =" float: none; "Title =" 5.png" alt = "wkiom1pymdetx8jraapzuptiifo622.png"/>
Switch to cloudfront and click Create distribution.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/42/A1/wKioL1PYmVbz3A2hAABgyTzEs_s201.png "style =" float: none; "Title =" 7.png" alt = "wkiol1pymvbz3a2haabgytzes_s201.png"/>
Select Web. rtmp is prepared for streaming media.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/42/A1/wKiom1PYmECTetRbAAB67D_owQs365.png "style =" float: none; "Title =" 8.png" alt = "wkiom1pymectetrbaab67d_owqs365.png"/>
Domain Name: enter the name of the S3 bucket, and Other Default options
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/42/A1/wKioL1PYmV7wA9E8AACk0x6jV54984.png "style =" float: none; "Title =" 9.png" alt = "wkiol1pymv7wa9e8aack0x6jv54984.png"/>
Price class can be selected in the world, I select the United States and Europe
I also added a cname because the URL automatically generated by cloudfront is too hard to remember. At the same time, I also need to add the corresponding cname In the DNS control panel.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/42/A1/wKiom1PYmEbRMIn-AABjUGPIN3w874.png "style =" float: none; "Title =" 10.png" alt = "wKiom1PYmEbRMIn-AABjUGPIN3w874.png"/>
Click "OK" to create the cluster. The cluster sends the related configurations (not specific content) to all edge servers. This process takes about 15 minutes.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/42/A1/wKiom1PYmEjzEsHYAABjIPOegDs044.png "style =" float: none; "Title =" 11.png" alt = "wkiom1pymejzeshyaabjipoegds044.png"/>
Then, log on to Godaddy and add a cname
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/42/A1/wKioL1PYmWSgUNVmAABRLITvKyA998.png "style =" float: none; "Title =" 12.png" alt = "wkiol1pymwsgunvmaabrlitvkya998.png"/>
After adding it, wait for about 5 minutes to query it.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/42/A1/wKiom1PYmEyTxx83AAAyg-kJnaQ628.png "style =" float: none; "Title =" 13.png" alt = "wKiom1PYmEyTxx83AAAyg-kJnaQ628.png"/>
Resolved the cname.
You can see that the corresponding cloudfront URL has multiple server addresses, which are the addresses of edge servers.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/42/A2/wKioL1PYmXGSQOe9AAAY-yZ01Rw401.png "style =" float: none; "Title =" 17.png" alt = "wKioL1PYmXGSQOe9AAAY-yZ01Rw401.png"/>
After 15 minutes, the configuration is complete.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/42/A1/wKiom1PYmFminwDSAABiVZbKb7I921.png "style =" float: none; "Title =" 18.png" alt = "wkiom1pymfminwdsaabivzbkb7i921.png"/>
Let's test whether it works.
Log on to this test site http://tools.pingdom.com/
First, test the S3 initial address. It takes about 4.66s to open it.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/42/A2/wKioL1PYmX_hJGlRAAHM-zWhLi4336.png "style =" float: none; "Title =" s3.png "alt =" wKioL1PYmX_hJGlRAAHM-zWhLi4336.png "/>
Then test the URL after CDN, which only takes 724 Ms
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/42/A6/wKioL1PYnUOTqmqCAAFr7cgGLa0740.png "style =" float: none; "Title =" CDN. PNG "alt =" wkiol1pynuotqmqcaafr7cggla0740.png "/>
Through Color comparison, we can find that DNS resolution, connection, and data download time are greatly reduced!
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/42/A6/wKiom1PYnCvhBbekAAArZJY19qU023.png "style =" float: none; "Title =" color. PNG "alt =" wkiom1pyncvhbbekaaarzjy19qu023.png "/>
This article from the "Mapo tofu" blog, please be sure to keep this source http://beanxyz.blog.51cto.com/5570417/1532813