# Edge caching

Cache successful GET responses at the edge, so repeat requests are answered instantly without running your code.

For `GET` functions whose response doesn't change on every call — a product catalog, exchange rates, a rendered image — turn on edge caching in the function's settings and choose how long to keep responses, from 1 second to 1 day.

## How it works

- Only successful (2xx) responses of the **live** version are cached. Draft requests (`?test`) are never cached.
- Requests that carry an [API key](/api-keys) are never cached.
- Repeat requests for the same URL (including the query string) are answered from the cache: your code doesn't run, nothing is logged and no [Run credits](/plans-and-credits#run-credits) are used.
- Responses of functions without caching are sent with `cache-control: no-store`.

## Clear the cache

After changing data that cached responses depend on, purge the cache from the function's settings, or:

```bash
wisp purge orders   # one function
wisp purge          # every cached function of the project
```

Publishing a version clears the cache of every cached function automatically, so callers get the new code's responses right away.
