# cache-penetration

Published articles for cache-penetration.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Negative caching protects databases from repeated lookups for nonexistent keys

DevFeed: [Negative caching protects databases from repeated lookups for nonexistent keys](<https://devfeed.tech/articles/negative-caching-the-misses-cost-more-than-the-hits-39602.md>)

Original publisher: [Read original article](<https://ankit-rana.com/logs/50-negative-caching-misses-cost-more/>)

Author: hello@ankit-rana.com

Published: 2026-09-09T00:00:00Z

Content type: tutorial

Language: en

Sources: [Ankit Rana | Mechanical Sympathy](<https://devfeed.tech/sources/ankit-rana-mechanical-sympathy.md>)

Topics: [Caching](<https://devfeed.tech/topics/caching.md>), [Cache](<https://devfeed.tech/topics/cache.md>), [Database](<https://devfeed.tech/topics/database.md>), [Security](<https://devfeed.tech/topics/security.md>), [Latency](<https://devfeed.tech/topics/latency.md>)

Tags: [cache](<https://devfeed.tech/tags/cache.md>), [cache-penetration](<https://devfeed.tech/tags/cache-penetration.md>), [caching](<https://devfeed.tech/tags/caching.md>), [database](<https://devfeed.tech/tags/database.md>), [negative-caching](<https://devfeed.tech/tags/negative-caching.md>), [protection](<https://devfeed.tech/tags/protection.md>), [redis](<https://devfeed.tech/tags/redis.md>), [reliability](<https://devfeed.tech/tags/reliability.md>), [security](<https://devfeed.tech/tags/security.md>), [ttl](<https://devfeed.tech/tags/ttl.md>)

### AI overview

Negative caching prevents repeated database queries for nonexistent keys by storing a distinguishable marker for negative results. The article explains how partner integrations, scrapers, stale clients, migrations, or attackers can exploit this gap and recommends using a shorter TTL for negative entries.

### Source excerpt

A cache that stores only found values gives you no protection against lookups for things that do not exist, and a miss on a nonexistent key costs the full origin query every single time. If the key is user supplied, an attacker can generate unlimited unique misses and bypass the cache entirely, which is cache penetration. Caching the negative result fixes it, with a shorter TTL than positive entries because a value appearing is a much more likely event than one disappearing.