Bird
0
0

Why might event-based cache invalidation be preferred over TTL in a REST API with highly dynamic data?

hard📝 Conceptual Q10 of 15
Rest API - Caching Strategies
Why might event-based cache invalidation be preferred over TTL in a REST API with highly dynamic data?
ABecause TTL invalidation requires manual clearing
BBecause it removes stale data immediately after changes
CBecause event-based invalidation stores data longer
DBecause TTL always causes cache to never expire
Step-by-Step Solution
Solution:
  1. Step 1: Understand event-based invalidation benefit

    It removes stale cache right after data changes, keeping data fresh.
  2. Step 2: Clarify TTL limitations

    TTL expires cache after fixed time, which may delay stale data removal; TTL does not require manual clearing.
  3. Final Answer:

    Because it removes stale data immediately after changes -> Option B
  4. Quick Check:

    Event-based = instant stale data removal [OK]
Quick Trick: Event-based invalidation is instant, TTL waits [OK]
Common Mistakes:
MISTAKES
  • Believing TTL never expires cache
  • Thinking event-based stores data longer
  • Assuming TTL needs manual clearing

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes