Create a solution using AWS S3 and CloudFront to serve static assets (images and videos), with a focus on performance optimization through differentiated caching strategies based on file types.
- Create an AWS account on Free Tier.
- Setup a new AWS S3 bucket configured for static website hosting:
- Set the bucket policy to allow public read-only access for all objects.
- Upload the example assets to your bucket.
- Create a CloudFront distribution with your S3 bucket as the origin:
- Create behaviours to cache files according to their type using the path pattern feature:
- JPG & PNG: 12 hours
- GIF: 24 hours
- MP4: 48 hours
- Setup 2 response policies that adds headers that instruct the browser how to cache files locally:
- JPG & PNG: 24 hours
- GIF & MP4: 72 hours
- Configure the distribution to support HTTPS
- Create behaviours to cache files according to their type using the path pattern feature:
Document your setup in a Google Doc:
- Include demo links for each file type
- Include screenshots of all relevant config
- Explain your working
We'll let you know once we have reviewed your work so you can shut the AWS account down.