Caching
The Expo Open OTA server uses a cache to improve performance and reduce server load by avoiding repeated computations.
Cache Usage
The cache is primarily used for:
-
Storing the computed
lastUpdateId
for a given platform and runtime version- This prevents the need to recompute the last update for every request, significantly speeding up responses.
-
Caching the computed manifest
- Manifest generation can be an expensive operation.
- By caching the results, we reduce response times and improve overall performance.
The environment variables required for each storage solution are listed below, you can set them in a .env
file in the root of the project or keep them in a safe place to prepare for deployment.
- Local cache
- Redis
This cache solution is not recommended for production use. It is intended for development and testing purposes only. If you really want to use it in production, make sure to not have multiple instances of the server running, as the cache is stored locally and not shared between instances.
Local cache is the default cache solution used by the server. It stores the cache in memory and is not shared between instances of the server. This means that the cache is lost when the server is restarted. No additional configuration is required to use the local cache.
To use Redis as your cache solution, you need to set the following environment variables:
REDIS_HOST=your-redis-host
REDIS_PORT=your-redis-port
REDIS_PASSWORD=your-redis-password
REDIS_USE_TLS=true // optional if you are using a TLS connection