QuestionQ317

Infrastructure and Automation

Question Image

Refer to the exhibit. A Python API server has been deployed. Metrics and logs show increased load. Which two approaches must be used to optimize API usage on the server?

Choose two
  • A Include the Content-Type header in the API response.
  • B Leverage middleware caching and respond with HTTP code 204 in the API response.
  • C Include the ETag header in the API response.
  • D Include the Last-Modified header in the API response.
  • E Change the query to be more efficient.
Explanation

An ETag identifies a particular representation version, enabling conditional GET requests with If-None-Match; if the representation has not changed, the server can return 304 Not Modified without retransmitting the response body. Middleware caching prevents repeated requests from repeatedly reaching the database, and 204 No Content correctly represents a successful request with no unread-message representation to send. Last-Modified is a less precise alternative validator, while Content-Type does not reduce server load.

Learn more

Community Discussion

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