Problem Statement
What is negative caching and when is it useful?
Explanation
If a key is often requested but absent, a short-lived negative cache avoids repeated origin hits. Keep the TTL small so creation appears quickly.
This is common for DNS and user lookups where non-existence is frequent.
Code Solution
SolutionRead Only
if(db.miss) cache.set(k, NULL, ttl=10s);
