Amazon CloudFront: A brief introduction to the problem of optimizing web content delivery…and the AWS’s solution.
We’re going to learn about Amazon CloudFront and how to make it work for you. First, since CloudFront is a kind of content delivery network (CDN), it’s probably worthwhile spending a bit of time discussing exactly how CDNs work, and what they do.
Brief introduction to CDNs
The idea of a content delivery network (sometimes called a content distribution network) is nothing new. It’s really nothing more than a set of servers distributed across the Internet to serve highly available, high performance content to end-users.
The primary goal of a CDN is delivering content from providers (like media companies) to their audiences as quickly and reliably as possible. The model works by delivering content from the CDN server closest to the users who will consume it, thereby eliminating as many network hops as possible.
Among other advantages, a CDN can:
- Offload traffic served directly from the content provider’s origin infrastructure.
- Help manage denial-of-service attacks by absorbing some of the traffic.
- Offer higher availability, lower network latency, and lower packet loss.
- Sometimes reduce your hosting costs.
- Handle increased numbers of concurrent users.
If there are advantages, there will be some negatives too:
- Lock-in dependency on a single CDN provider for support availability.
- Lock-in dependency on a single CDN provider for infrastructure availability.
- Not all CDN providers will have data centers in exactly the geographic locations you need them for each of your projects.
The CDN market has many active providers, including CloudFare, Akamai Technologies, and Limelight Networks.
So we’ve described CDNs and some of the major players. But there’s someone really obvious we’ve left out.
As the cloud continues to dominate application and content delivery, Amazon Web Services continues to dominate the cloud. There can’t be many providers who haven’t at least considered moving their operations to the AWS cloud. At the same time, AWS works hard to understand its customers’ requirements and wants to be able to provide an environment that addresses all their needs. Since distributed content delivery is a common need, it only makes sense that AWS would offer CloudFront: a fully integrated solution.
To achieve the low latency connections providers need, CloudFront uses a global network of edge locations:
How Amazon CloudFront works
Getting started with Amazon CloudFront is quick and simple. Let’s see what has to be done to configure CloudFront.
- The first step is to decide on an origin server. Like all CDN providers, CloudFront requires you to define the server hosting the content you want CloudFront to deliver across the distributed network. The origin server can be an S3 bucket or an HTTP server (either based in Amazon’s EC2 or locally in your own datacenter).
- Next, you will upload your content to the origin server. Anything that can be served over HTTP or a supported version of Adobe RTMP can be used. Typically, the content consists of web pages, images, and media files (video and audio).
- The next step is the most important one. You will need to create a distribution. There are two kinds of distribution that you can create: web distributions for HTTP/HTTPS, and RTMP Distributions for RTMP and its variants. Distributions are the way you tell CloudFront what content to use and what to do with it.
- If you want your content to be delivered over either HTTP or HTTPS, select a Web distribution, but if your deployment involves real-time data using RTMP protocols, then you should choose an RTMP distribution.
- You can create URL-matching rules for your distributions. For example, you could decide that any request that includes the string “/books/*” should fetch data from your HTTP server, but a request containing “/author/*” should go to S3.
- Finally, use the domain name endpoint that CloudFront gives you as URLs through which your users can access your content.
Note: You can fine-tune your distribution by setting values like the expiration time for files to remain in cache before they are refreshed, and which groups of CloudFront edge locations you’d like to use (i.e., US only, US and Europe, or all locations).
Once the setup is ready, your Amazon CloudFront distribution is ready to serve requests. Your DNS service will route a request from your end user to the CloudFront endpoint URL, and CloudFront will send it to the edge location that can best serve the user’s request. CloudFront first checks its cache for the requested files, if it’s there it’s all good. But if it’s not found in the cache, it checks your distribution configuration and forwards the request to the origin server.
This diagram can help to visualize the process:
Important Amazon CloudFront features
Besides the more obvious features we’ve already seen, with Amazon CloudFront, you can also:
- Enable AWS WAF (Web Application Firewall) which can help secure your content.
- Engage in many e-commerce activities, since CloudFront is PCI DSS Compliant.
- Configure the default TTL & Max TTL values (to control how long CloudFront will hold items in cache).
- Invalidate Multiple Objects.
- Add signed cookies for private content.
- Add support for advanced SSL features: Perfect Forward Secrecy, OCSP Stapling, and Session Tickets.
- Use CloudFront as part of the AWS Free Usage Tier.
I hope this blog was able to satisfy at least your initial curiosity about Amazon CloudFront. This is an exciting and useful area and I strongly encourage you to investigate the free 7-day trial subscription from Cloud Academy. They offer multiple learning products on this very topic:
- Video Course: Working with Amazon CloudFront features
- Multiple Quizzes: Various Difficulty Levels of AWS CloudFront Quiz
- Hands-on Labs: Serve Your Files Using The CloudFront CDN
I’ve tried to inspire your desire for greater learning. I haven’t attempted a deep dive because that must requires greater time and space than this blog offers. What I’d like you to take away from reading this post is a familiarization with the way that AWS handles the problem of fast and efficient content delivery. Maybe you are motivated to dig deeper with Cloud Academy’s labs, video courses or quizzes. Cloud Academy labs let learners work in a real AWS environment without setting up an AWS account. So take the trial and see what you think.
Feedback is critical to us, so let me know what you think and where we can do better.
New Content: Alibaba, Azure AZ-303 and AZ-304, Site Reliability Engineering (SRE) Foundation, Python 3 Programming, 16 Hands-on Labs, and Much More
This month our Content Team did an amazing job at publishing and updating a ton of new content. Not only did our experts release the brand new AZ-303 and AZ-304 Certification Learning Paths, but they also created 16 new hands-on labs — and so much more! New content on Cloud Academy At...
Blog Digest: Which Certifications Should I Get?, The 12 Microsoft Azure Certifications, 6 Ways to Prevent a Data Breach, and More
This month, we were excited to announce that Cloud Academy was recognized in the G2 Summer 2020 reports! These reports highlight the top-rated solutions in the industry, as chosen by the source that matters most: customers. We're grateful to have been nominated as a High Performer in se...
Which Certifications Should I Get?
The old AWS slogan, “Cloud is the new normal” is indeed a reality today. Really, cloud has been the new normal for a while now and getting credentials has become an increasingly effective way to quickly showcase your abilities to recruiters and companies. With all that in mind, the s...
New Content: AWS, Azure, Typescript, Java, Docker, 13 New Labs, and Much More
This month, our Content Team released a whopping 13 new labs in real cloud environments! If you haven't tried out our labs, you might not understand why we think that number is so impressive. Our labs are not “simulated” experiences — they are real cloud environments using accounts on A...
Kickstart Your Tech Training With a Free Week on Cloud Academy
Are you looking to make a jump in your technical career? Want to get trained or certified on AWS, Azure, Google Cloud Platform, DevOps, Kubernetes, Python, or another in-demand skill? Then you'll want to mark your calendar. Starting Monday, June 22 at 12:00 a.m. PDT (3:00 a.m. EDT), ...
New Content: AZ-500 and AZ-400 Updates, 3 Google Professional Exam Preps, Practical ML Learning Path, C# Programming, and More
This month, our Content Team released tons of new content and labs in real cloud environments. Not only that, but we introduced our very first highly interactive "Office Hours" webinar. This webinar, Acing the AWS Solutions Architect Associate Certification, started with a quick overvie...
Azure vs. AWS: Which Certification Provides the Brighter Future?
More and more companies are using cloud services, prompting more and more people to switch their current IT position to something cloud-related. The problem is most people only have that much time after work to learn new technologies, and there are plenty of cloud services that you can ...
Blog Digest: 5 Reasons to Get AWS Certified, OWASP Top 10, Getting Started with VPCs, Top 10 Soft Skills, and More
Thank you for being a valued member of our community! We recently sent out a short survey to understand what type of content you would like us to add to Cloud Academy, and we want to thank everyone who gave us their input. If you would like to complete the survey, it's not too late. It ...
New Content: Alibaba, Azure Cert Prep: AI-100, AZ-104, AZ-204 & AZ-400, Amazon Athena Playground, Google Cloud Developer Challenge, and much more
This month, our Content Team released 8 new learning paths, 4 courses, 7 labs in real cloud environments, and 4 new knowledge check assessments. Not only that, but we introduced our very first course on Alibaba Cloud, and our expert instructors are working 'round the clock to create 6 n...
Top 5 Reasons to Get AWS Certified Right Now
Cloud computing trends are on the rise and have been for some time already. Fortunately, it’s never too late to start learning cloud computing. Skills like AWS and others associated with cloud computing are in high demand because cloud technologies have become crucial for many businesse...
Introducing Our Newest Lab Environments: Lab Playgrounds
Want to train in a real cloud environment, but feel slowed down by spinning up your own deployments? When you consider security or pricing costs, it can be costly and challenging to get up to speed quickly for self-training. To solve this problem, Cloud Academy created a new suite of la...
Blog Digest: AWS Breaking News, Azure DevOps, AWS Study Guide, 8 Ways to Prevent a Ransomware Attack, and More
New articles by topic AWS Azure Data Science Google Cloud Cloud Adoption Platform Updates & New Content Security Women in Tech AWS Breaking News: All AWS Certification Exams Now Available Online As an Advanced AWS Technology Partner, C...