Cloudfront Request Routing | AWS Certified Advanced Networking - Specialty

Which Cloudfront Requests Avoid Direct Origin Server Communication?

Prev Question Next Question

Question

Which of the following request to Cloudfront will not the request directly back to the origin server?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Answer - A.

Apart from the GET method , the other methods will send the request directly back to the origin server.

The GET request will first allow to poll the edge locations for content.

Only of the content is not available , the request will be sent to the origin server to get the content.

For more information on the update HTTP requests for Cloudfront, please visit the link:

https://aws.amazon.com/about-aws/whats-new/2013/10/15/amazon-cloudfront-now-supports-put-post-and-other-http-methods/

CloudFront is a Content Delivery Network (CDN) service provided by AWS that speeds up the delivery of content such as web pages, videos, and images to end-users. When a user requests content from a website that is served by CloudFront, the request is routed to the nearest CloudFront edge location, which then serves the content from its cache or retrieves it from the origin server if the content is not in the cache.

When a request is made to CloudFront, it can either be a cacheable request or a non-cacheable request. A cacheable request is one that can be served directly from the CloudFront cache without having to go back to the origin server, while a non-cacheable request requires CloudFront to retrieve the content from the origin server.

CloudFront automatically caches HTTP GET and HEAD requests, which are considered cacheable requests. This means that if a user makes a GET or HEAD request for content that is already in the CloudFront cache, CloudFront will serve the content directly from the cache without having to go back to the origin server.

On the other hand, HTTP POST, PUT, DELETE, OPTIONS, and PATCH requests are considered non-cacheable requests by CloudFront. This means that CloudFront will always forward these requests directly back to the origin server, even if the content is already in the CloudFront cache.

Therefore, the answer to the question is: D. OPTIONS. All of the other HTTP methods (GET, POST, PUT) will be forwarded to the origin server if the content is not already in the CloudFront cache. However, OPTIONS requests are also non-cacheable requests but they will not be forwarded to the origin server if the content is not already in the CloudFront cache. Instead, CloudFront will respond with the appropriate headers indicating what HTTP methods are allowed for the requested resource.

In summary, when a user requests content from CloudFront, HTTP GET and HEAD requests are cached and served directly from the CloudFront cache if they are available. HTTP POST, PUT, DELETE, and PATCH requests are always forwarded to the origin server. HTTP OPTIONS requests are non-cacheable requests but will not be forwarded to the origin server.