---
id: "cache-missing-eviction-policy"
type: "rule"
severity: "warning"
url: "https://localhost:3000/catalogue/rules/cache-missing-eviction-policy"
---

# Cache without eviction policy

| | |
|---|---|
| Severity | warning |
| Selects | every node of kind cache |
| Components in scope | 37 |

## Why

A cache with no declared eviction policy inherits whatever the vendor chose, and most vendors default to evicting nothing. The cache fills up and then starts refusing writes.

## What it checks

It looks at every node of kind cache, and fires when:

- any of these hold:
  - the node's `evictionPolicy` has no value
  - the node's `evictionPolicy` is "none"

Message template:

```
Cache '{{node.id}}' has no eviction policy. Declare lru, lfu or ttl, or justify none explicitly.
```

## Applies to

- [Cache](https://localhost:3000/catalogue/kinds/cache.md) `cache`

37 catalogue components fall under it.

## Tripped by

Reference designs whose broken twin names this rule in its header:

- [ad-click-aggregation](https://localhost:3000/d/zeema/ad-click-aggregation)
- [cloudflare-edge](https://localhost:3000/d/zeema/cloudflare-edge)
- [figma-multiplayer](https://localhost:3000/d/zeema/figma-multiplayer)
- [hotel-reservation](https://localhost:3000/d/zeema/hotel-reservation)
- [instagram-feed](https://localhost:3000/d/zeema/instagram-feed)
- [khan-academy-goliath](https://localhost:3000/d/zeema/khan-academy-goliath)
- [linear-sync](https://localhost:3000/d/zeema/linear-sync)
- [lyft-envoy](https://localhost:3000/d/zeema/lyft-envoy)
- [metrics-monitoring](https://localhost:3000/d/zeema/metrics-monitoring)
- [multi-region-web](https://localhost:3000/d/zeema/multi-region-web)
- [nearby-friends](https://localhost:3000/d/zeema/nearby-friends)
- [reddit-feed](https://localhost:3000/d/zeema/reddit-feed)
- [tinder-geo](https://localhost:3000/d/zeema/tinder-geo)
- [whatsapp-messaging](https://localhost:3000/d/zeema/whatsapp-messaging)
- [youtube-upload-playback](https://localhost:3000/d/zeema/youtube-upload-playback)

## Source (`rule` YAML, verbatim)

```yaml
# yaml-language-server: $schema=../schema/rule.schema.json
# No declared eviction policy means the vendor default decides, and the vendor default is
# usually noeviction. Tripped by designs/multi-region-web.broken.yaml.
schemaVersion: "1"
type: "rule"
id: "cache-missing-eviction-policy"
severity: "warning"
select:
  node:
    kind: "cache"
when:
  any:
    - prop: "evictionPolicy"
      exists: false
    - prop: "evictionPolicy"
      equals: "none"
message: "Cache '{{node.id}}' has no eviction policy. Declare lru, lfu or ttl, or justify none explicitly."
```

Human page: https://localhost:3000/catalogue/rules/cache-missing-eviction-policy
