Let's imagine a website is hosted somewhere in the geographical region on a S3 Bucket and A, B, C, D, and E are the users located in different regions.
User A is accessing the website's contents fastly as the distance between user A and the S3 Bucket location is less. In case of User B, it is trying to access the content with some slowness or latency due to the longer distance.
To overcome this issue we can use AWS CloudFront service by enabling the Distribution/edge location, then a user who is located anywhere in the world can access the contents fastly.
After enabling the distribution/edge location, if user F wants to access the website contents then the request will first go to the nearest edge location and then routed to the S3 bucket, and then the contents will be stored(cached) temporarily to that edge location and the user F access the contents directly from the nearest edge location.
Next time whenever a user nearer to User F wants to access the contents feels no latency as contents are stored already at the nearest edge location.
Please note - Edge location is the location where contents will be cached(stored temporarily). This is separate from an AWS Region or AZ.
Thank you so much for taking your valuable time for reading.
I have tried my level best to explain as much information as possible in the easiest manner. Any feedback for further improvement will be highly appreciated!
#WeMakeDevs
We can connect at: Rahul Kumar Verma | LinkedIn