Amazon CloudFront is used as a CDN (content delivery network) for servers deployed at on-premises data centers.
Origin servers deployed at on-premises data centers are adding the Cache-Control header.
Management is looking for a setting in Amazon CloudFront that will control cache duration in CloudFront Cache irrespective of the values defined in the Cache-Control header. Which header can be used with Amazon CloudFront to specify the time for which objects remain in the CloudFront cache?
Click on the arrows to vote for the correct answer
A. B. C. D.Correct Answer: C.
Object Cache Headers are used to specify the minimum & maximum time an object is cached in an Amazon CloudFront Cache.
Values specified in these headers will be used for object caching irrespective of values in Cache-Control headers defined by the origin servers.
Option A is incorrect as these headers will be used to specify which content needs to be cached by Amazon CloudFront.
Option B is incorrect as these headers are used to cache different versions of the content based upon values specified in the query string.
Option D is incorrect as this is an invalid header for specifying the period for object caching in Amazon CloudFront.
These headers are used to add custom headers while sending requests to the origin.
For more information on object caching with Amazon CloudFront, refer to the following URL,
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesObjectCachingThe correct answer to the question is C. Origin Cache Headers.
Amazon CloudFront is a content delivery network (CDN) service that speeds up the delivery of static and dynamic web content, such as HTML, CSS, JavaScript, images, and videos. CloudFront delivers the content through a global network of edge locations that are closer to the end-users, reducing the latency and improving the user experience.
When CloudFront receives a request for an object, it first checks whether the object is already in its cache. If the object is in the cache, CloudFront returns it to the requester from the edge location, which is faster than retrieving it from the origin server. However, if the object is not in the cache, CloudFront retrieves it from the origin server, caches it at the edge location, and returns it to the requester.
The caching behavior of CloudFront is controlled by the cache headers set by the origin server. The Cache-Control header is the most commonly used header to specify how long an object should be cached. When CloudFront receives an object with a Cache-Control header, it caches the object according to the specified time period.
However, in some cases, management may want to override the Cache-Control header and set a specific cache duration in CloudFront, regardless of the value set by the origin server. This can be achieved by using the Origin Cache Headers in CloudFront.
Origin Cache Headers allow you to specify the cache duration for objects in CloudFront cache, independently of the values defined in the Cache-Control header. You can set the cache duration in seconds using the "Maximum TTL" (Time-To-Live) value. The Maximum TTL is the maximum time period for which CloudFront caches an object in the edge location.
In summary, Origin Cache Headers can be used to control the cache duration in CloudFront, irrespective of the values defined in the Cache-Control header by the origin server. The other options listed in the question, Whitelist Headers, Query String Caching Headers, and Origin Custom Headers, are not related to cache duration and are not relevant to this scenario.