API Testing · Senior · Question 40 of 75
What is a good strategy for testing a CDN or cache in front of an API?
- 1Check cache keys,
Vary, private data and purge after updates - 2Assume the CDN works and test only the origin server
- 3Disable the CDN in all environments to avoid caching bugs
Show the answer
Correct answer: Check cache keys, Vary, private data and purge after updates
Explanation
Wrong cache keys can serve one user's data to another or ignore language headers. Tests send varied headers and check hits and misses.