System Design · Junior · Question 33 of 75
Why version an API (/api/v1/...)?
- ✓Correct answer: To change the contract without breaking clients that already work
- 2To speed up server responses through per-version caching
- 3So that search engines index new versions of the site separately
Explanation
Mobile apps and old browser tabs keep using the old contract for a long time. Breaking changes go into a new version, while non-breaking ones (new optional fields) are added to the existing one. The version can be passed in the URL or a header.