# Cache

> Store responses on the OpenWAF edge, purge them on every node in about a second and send 103 Early Hints. Off until you turn it on.

The OpenWAF edge cache stores cacheable responses on each edge node, so repeat requests are answered without reaching your origin. It follows the same model as the big CDNs, with safer defaults: static files by extension are cached out of the box, HTML and JSON only when a rule says so, and your origin's `Cache-Control` is respected.

> **Note**
>
> The edge cache is in beta and is **off by default**. Nothing is cached until you turn it on for a zone or a name.


## How it fits

```text
request ─▶ WAF · rate limits · access gate · AI agents ─▶ cache ─▶ origin
```

Every security check runs **before** the cache. A request the WAF blocks never gets a cached response, and hits still count towards rate limits. The cache saves your origin work and your visitors time; it never skips security.

## Features

- **Safe defaults.** Static files (images, CSS, JS, fonts, media, archives, documents) are eligible; `Set-Cookie`, `private`, `no-store` and unknown `Vary` headers keep a response out of the cache. [Cache deception armor](https://developers.openwaf.dev/cache/default-behavior/#deception-armor) is on.
- **Cache rules.** Up to 25 rules to bypass paths or make HTML eligible, with edge and browser TTLs, query-string handling and stale content. Templates for WordPress, Next.js and static sites.
- **Fast purge.** By URL, prefix, hostname, `Cache-Tag` or everything. Edge nodes apply it within about a second, and you can watch each node confirm it.
- **Stale content.** Serve an expired copy while revalidating, or when the origin is down or answers 5xx.
- **103 Early Hints.** Let browsers start loading stylesheets, fonts and the main image while your origin still builds the page.
- **Clear debugging.** Every response carries `X-Cache-Status` and the standard `Cache-Status` header.

## Start here

- [Get started](https://developers.openwaf.dev/cache/get-started/): turn the cache on and check that it works.
- [Default behavior](https://developers.openwaf.dev/cache/default-behavior/): what is cached, for how long, and what never is.
- [Cache keys](https://developers.openwaf.dev/cache/cache-keys/): how requests map to cached objects; query strings and `Vary`.
- [Cache status headers](https://developers.openwaf.dev/cache/cache-status/): read `X-Cache-Status`, `Cache-Status` and `Age`.
- [Configure the cache](https://developers.openwaf.dev/cache/configure/): caching level, browser TTL, development mode and stale content.
- [Cache rules](https://developers.openwaf.dev/cache/cache-rules/): bypass or cache by path, extension, cookie or parameter.
- [Purge the cache](https://developers.openwaf.dev/cache/purge/): everything, URLs, prefixes, hostnames or tags, from the dashboard or CI.
- [Early Hints](https://developers.openwaf.dev/cache/early-hints/): send 103 responses with preload links.
- [Settings reference](https://developers.openwaf.dev/cache/settings/): every setting, default and limit.
- [Troubleshooting](https://developers.openwaf.dev/cache/troubleshooting/): why a response isn't cached.
