Amazon CloudFront is a 'pull-through cache'. This means that there is initially nothing in the cache.
It works like this:
Therefore, items are only stored in the cache when they are first requested. Plus, they are only stored in the edge location that was accessed by the user. So, if a user in Paris requests the resource, it will be stored in their edge location. But, when a user in Auckland requests the same resource, it will not be in their local cache until it is accessed by a nearby user.
Items remain in the cache for a period of time based on the recency of requests and the size of the object. CloudFront has very big caches -- they even cache Prime Video movies!
So, the answer to your question about how to configure CloudFront to serve images from the cache is that there is nothing to configure -- it will be done automatically when a resource is first requested. Just run your command again and you'll see that it was a 'Hit' from the cache.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.