Bird
0
0

If a REST API caches responses for 10 minutes, what will happen if a client requests the same data after 15 minutes?

medium📝 Predict Output Q5 of 15
Rest API - Caching Strategies
If a REST API caches responses for 10 minutes, what will happen if a client requests the same data after 15 minutes?
AThe server fetches fresh data and updates the cache
BThe server returns the cached response from 10 minutes ago
CThe server returns an error due to expired cache
DThe server ignores the request
Step-by-Step Solution
Solution:
  1. Step 1: Understand cache expiration

    Cache expires after 10 minutes, so after 15 minutes it is invalid.
  2. Step 2: Determine server action on expired cache

    The server fetches fresh data and updates the cache for new requests.
  3. Final Answer:

    The server fetches fresh data and updates the cache -> Option A
  4. Quick Check:

    Expired cache triggers fresh fetch = B [OK]
Quick Trick: Expired cache causes fresh data fetch [OK]
Common Mistakes:
MISTAKES
  • Assuming old cache is still used
  • Thinking expired cache causes errors
  • Believing server ignores requests

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes