QuestionQ281

Using APIs

Question Image

Refer to the exhibit. An application-hosting server in the local data center is receiving large volumes of traffic from end users. A developer must optimize this API server to reduce the load on its host. Which two methods can optimize this code through HTTP cache controls?

Choose two
  • A Include the “Content-Type” header in the API response.
  • B Include the “Last-Modified” header in the API response.
  • C Include the “ETag” header in the API response.
  • D Leverage middleware caching and respond with HTTP code 204 in the API response.
  • E Leverage middleware caching and respond with HTTP code 104 in the API response.
Explanation

Last-Modified and ETag are HTTP response validators. They allow cached responses to be conditionally revalidated with If-Modified-Since and If-None-Match; when the representation is unchanged, a 304 Not Modified response avoids retransmitting the response body. HTTP caching standards identify both headers as validators used for cache validation.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!