MCPA - Level 1 Exam QuestionsBrowse all questions from this exam

MCPA - Level 1 Exam - Question 27


The responses to some HTTP requests can be cached depending on the HTTP verb used in the request.

According to the HTTP specification, for what HTTP verbs is this safe to do?

Show Answer
Correct Answer: D

According to the HTTP specification, responses to GET and HEAD requests can be safely cached because these requests are considered safe and idempotent, meaning they do not result in a change or deletion of resources on the server. OPTIONS requests, although rarely cached, are also safe and idempotent as they are used for describing the communication options available for the target resource without modifying it. Therefore, it is safe to cache responses for GET, OPTIONS, and HEAD requests.

Discussion

10 comments
Sign in to comment
Pavan_NagineniOption: D
Jul 24, 2021

D. GET, OPTIONS, HEAD

AB317Option: D
Aug 6, 2021

Answer: D

Outdoor25Option: D
Dec 29, 2021

D is correct

FL107Option: B
Apr 21, 2022

Answer: B

calazansOption: D
Jun 22, 2022

GET, OPTIONS, HEAD

sirious09Option: B
Dec 19, 2022

B. OPTIONS is not cacheable. https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/OPTIONS https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST

cuisal92Option: D
Jan 25, 2023

D. GET, OPTIONS, HEAD

vikas_muleOption: D
Mar 29, 2023

D is correct

FreedoxOption: D
May 31, 2023

The answer is D. According to the HTTP specification, it is safe to cache responses for HTTP verbs GET, OPTIONS, and HEAD. This is because these requests are considered "safe" and do not modify or delete any resources on the server. Therefore, caching responses for these requests can improve performance and reduce the number of requests made to the server. However, caching responses for requests that modify or delete resources (such as PUT, POST, and DELETE) can cause issues and should be avoided.

Neo_0000Option: B
Apr 20, 2024

After seeing the many comments here and elsewhere, I was choosing option D, which is wrong. OPTIONS HTTP method is non-cacheable. The right answer is B. By default, POST HTTP method is non-cacheable but by adding Cache-Control headers, it can be made cacheable.

Alandt
Jul 3, 2024

You are wrong. According to the official Mulesoft practice exam the correct answer is D. Don't ask me why, but that's the answer they have given so it should be right.