System Design · Middle · Question 53 of 75
When does the browser send a CORS preflight request, and how can you avoid it?
- ✓Correct answer: For "non-simple" requests (e.g.
PUT, JSON content type, custom headers); serving the API from the same origin avoids it - 2Before every request
- 3Only for images
Explanation
The extra OPTIONS round trip adds latency. Access-Control-Max-Age lets browsers cache the preflight result.