Bird
0
0

If your Django cache is configured to use Redis at redis://127.0.0.1:6379/1 but the Redis server is down, what will happen when Django attempts to set a cache key?

medium📝 component behavior Q4 of 15
Django - Caching
If your Django cache is configured to use Redis at redis://127.0.0.1:6379/1 but the Redis server is down, what will happen when Django attempts to set a cache key?
ADjango will raise a connection error and fail to cache the data
BDjango will silently fallback to LocMemCache
CDjango will cache data locally without errors
DDjango will queue the cache operation until Redis is available
Step-by-Step Solution
Solution:
  1. Step 1: Understand RedisCache behavior on connection failure

    If Redis is down, Django cannot connect and will raise an error.
  2. Step 2: Check fallback behavior

    Django does not fallback automatically to other caches unless explicitly configured.
  3. Final Answer:

    Django will raise a connection error and fail to cache the data -> Option A
  4. Quick Check:

    No automatic fallback; connection error occurs if Redis is down [OK]
Quick Trick: Redis down causes connection error; no fallback by default [OK]
Common Mistakes:
MISTAKES
  • Assuming automatic fallback to local cache
  • Thinking cache operations queue automatically

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes