Refer to the exhibit. A Python API server has been deployed. Based on metrics and logs, increased load has been noticed. Which two approaches must be taken 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.
question is similar to question 277.
I believe answers should be:
Include the “Last-Modified” header in the API response.
Include the “ETag” header in the API response.
chatgpt:
o optimize API usage on the server under increased load, you should consider:
B. Leverage middleware caching and respond with HTTP code 204 in the API response.
Middleware caching can significantly reduce load by storing the results of expensive queries and serving them for subsequent requests. However, responding with HTTP 204 is not typically associated with caching because 204 means "No Content," which would indicate that there is no data to cache. Instead, a 304 "Not Modified" response might be used in conjunction with ETags or Last-Modified headers to indicate that the cached version of the response is still valid.
C. Include the ETag header in the API response.
The ETag (Entity Tag) header is used in HTTP to determine if a cached version of the requested resource is identical to the current version of the resource on the server. If the ETag matches, the server can respond with a 304 Not Modified status, indicating that the client can use its cached version, thus saving on database queries and reducing server load.
I know C and D both would help because they implement caching and therefore the server would be under less load. In theory, E could help, but looking at the code I can't see how it's being inefficient so I think this is irrelevant in this exampl
I think the best answers are **B. Leverage middleware caching and respond with HTTP code 204 in the API response** and **E. Change the query to be more efficient**. Here is why:
- **A. Include the Content-Type header in the API response** is not a good option, because it does not affect the performance of the server or the API usage.
The Content-Type header only tells the client what type of data is in the response body, but it does not reduce the load on the server or the network bandwidth.
- **E. Change the query to be more efficient** is a good option, because it can directly affect the performance of the server and reduce the API usage.
Changing the query to be more efficient means optimizing how the server accesses and processes data from databases or other sources.
This can reduce the CPU and memory usage of the server, as well as shorten the response time and network bandwidth.
- **B. Leverage middleware caching and respond with HTTP code 204 in the API response** is a good option, because it can improve the performance of the server and reduce the API usage.
Middleware caching is a technique that stores frequently used data or responses in a layer between the server and the client, so that the server does not have to process the same request again.
Responding with HTTP code 204 means that the server has successfully processed the request, but does not return any data in the response body. This can save network bandwidth and speed up the response time.
- **C. Include the ETag header in the API response** is not a good option, because it does not optimize the API usage on the server, but rather on the client side .
The ETag header is a way of validating if a cached resource on the client side is still fresh or not.
It can help avoid unnecessary requests from the client to the server, but it does not reduce the load on the server or improve its performance.
- **D. Include the Last-Modified header in the API response** is similar to C, as it is also a way of validating if a cached resource on the client side is still fresh or not.
It can help avoid unnecessary requests from the client to the server, but it does not reduce the load on the server or improve its performance.
This section is not available anymore. Please use the main Exam Page.350-901 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
mkOwl
Highly Voted 1 year, 2 months agodoble_h
Most Recent 6 months, 2 weeks agokati2k22cz
8 months agoThePokemonNuzlockingMaster
11 months, 1 week agowhipmuffin
1 year agowhipmuffin
1 year agowhipmuffin
1 year ago[Removed]
1 year, 2 months ago