How to optimize GET requests
To optimize GET requests, we can apply the same technique as with PUT requests. One is to parallelize GET requests, and the other is to use CloudFront to cache objects and reduce the number of GETs. This is because, as you already learned how the performance between S3 and CloudFront differs in How to measure throughput between S3 and CloudFront in the Chapter 5, Distributing Your Contents via CloudFront, CloudFront provides content with low-latency distributing for your content stored in your S3 bucket through a global network of edge locations.
We will see the difference of the performance using a simple curl
command.
Getting ready
You need to complete the following set up in advance:
- Sign up on AWS and be able to access S3 with your IAM credentials
- Install and set up AWS CLI in your PC or use Amazon Linux AMI
- Create and enable a CloudFront distribution over your bucket following the instruction, How to configure a CloudFront distribution on the Amazon S3 bucket...