Bird
0
0

You want to ensure a sensitive API response is never stored by browsers or intermediate caches. Which Cache-Control header should you use?

hard📝 Application Q15 of 15
Rest API - Caching Strategies
You want to ensure a sensitive API response is never stored by browsers or intermediate caches. Which Cache-Control header should you use?
ACache-Control: no-store, no-cache
BCache-Control: private, max-age=0
CCache-Control: public, max-age=0
DCache-Control: no-store
Step-by-Step Solution
Solution:
  1. Step 1: Identify directive that prevents any storage

    no-store tells browsers and caches not to store the response anywhere.
  2. Step 2: Compare with other options

    no-cache allows storing but requires revalidation; private allows browser-only caching; public allows shared caching.
  3. Final Answer:

    Cache-Control: no-store -> Option D
  4. Quick Check:

    no-store forbids all storage [OK]
Quick Trick: Use no-store to block all caching and storage [OK]
Common Mistakes:
MISTAKES
  • Using no-cache instead of no-store
  • Assuming private disables all caching
  • Setting max-age=0 without no-store

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes