Using S3 is having one centralized location where your files are stored, and regardless of where your website visitor is located, their web browser has to fetch the Audio, video, PDF or other media, only from that centralized location.
But adding CloudFront means, every file gets fetched from a datacenter closest to the visitor’s region.
So Amazon CloudFront is an additional layer that sits on top of your Amazon S3 bucket, and speeds up the delivery of the media in your S3 bucket. Think of it as adding “Turbo Boost” to your S3 files.
The image on the left above, shows that your Amazon S3 bucket is a single location stored in the cloud, and when visitors to your website from all over the world try to access a video, audio, pdf or other media stored in that S3 bucket, they are still served those files from that one central location. Which means, the farther they are geographically from your S3 bucket, the longer (even if it’s just milliseconds longer) it will take to serve them the file.
But CloudFront has various “edge locations” (those little clouds you see in the image on the right) spread globally. So when a US visitor tries to access, say, a video in your online course, if it’s the first time, then the “edge location” (cloud) closest to that person, will copy that file from your S3 bucket to the local cloud. And from that point onwards, every US person who tries to access that video, will be served that video from the local cloud, and not from the S3 bucket. And because Amazon has these edge locations all over the world, your visitors from all over the world will see that your videos, audio and PDF start loading super-fast, because it’s loading from a local cloud that’s closest to them.