> For the complete documentation index, see [llms.txt](https://mercure-technologies.gitbook.io/expo-open-ota/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mercure-technologies.gitbook.io/expo-open-ota/caching/overview.md).

# Overview

The server caches data to avoid repeated storage lookups and recomputations.

Set `CACHE_MODE=redis` to use Redis, or `CACHE_MODE=redis-sentinel` for a Sentinel-monitored Redis deployment. Any other value uses the in-memory cache.

### Cached data

The cache stores:

* **Update resolution** — the latest update ID for each app, platform, runtime version, and branch.
* **Computed manifests** — generated and signed manifests.
* **Dashboard responses** — app, branch, runtime version, and update listings.
* **Metrics working sets** — unique-user sets used by [Prometheus metrics](/expo-open-ota/monitoring/prometheus-and-grafana.md).

Active-user metrics use a four-hour sliding window. Error tracking uses a ten-minute window.

### Cache invalidation

Cache keys include the release version. A new server version invalidates previous entries automatically.

You do not need to flush the cache after an upgrade.

### Choose a cache backend

#### In-memory cache

The in-memory cache is the default. It requires no configuration.

It lives in the server process. A restart clears it. Replicas do not share it.

{% hint style="warning" %}
Use the in-memory cache only for a single server instance. With multiple replicas, each instance recomputes manifests and reports only its own metric users.
{% endhint %}

#### Redis

Use Redis for any multi-replica deployment. It shares cached data and metric working sets across replicas.

For high availability with automatic master failover, use `CACHE_MODE=redis-sentinel`.

See [Redis](/expo-open-ota/caching/redis.md) for connection, TLS, ACL, Sentinel, and key-prefix configuration.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://mercure-technologies.gitbook.io/expo-open-ota/caching/overview.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
