You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## zenith.json: What is it and why is it required?
55
97
Zenith looks for a file named "zenith.json" in the same folder where your root package.json file is. This file is used to determine the behavior of Zenith. It MUST include 'projects' and 'buildConfig' keys, and MAY include 'ignore' and 'appDirectories' keys. An example of usage is as follows.
56
98
```json
@@ -116,7 +158,9 @@ Zenith looks for a file named "zenith.json" in the same folder where your root p
116
158
The project uses several required environment variables and params. Without them, the tool will not work as intended.
117
159
### Environment Variables
118
160
```
119
-
- CACHE_TYPE (string): One of ['local', 'remote', 'local-first', 'remote-first'], 'local' by default. If 'remote', S3 environment variables are required.
161
+
- CACHE_TYPE (string): One of ['local', 'remote', 'redis', 'local-first', 'remote-first'], 'local' by default. If 'remote' or hybrid modes that include remote, S3 environment variables are required. If 'redis', REDIS_URL is required (defaults to redis://127.0.0.1:6379).
162
+
- REDIS_URL (string): Redis connection URL when CACHE_TYPE=redis. Default: redis://127.0.0.1:6379.
163
+
- REDIS_KEY_PREFIX (string): Prefix for all Redis cache keys when CACHE_TYPE=redis. Default: zenith:.
120
164
- S3_ACCESS_KEY (string): Access key to be used to get objects from and write objects to the buckets.
121
165
- S3_SECRET_KEY (string): Secret key to be used to get objects from and write objects to the buckets.
122
166
- S3_BUCKET_NAME (string): Bucket name to be written and read from.
@@ -145,6 +189,36 @@ export S3_REGION=us-east-1
145
189
```
146
190
Stop MinIO: `yarn minio:down`.
147
191
192
+
### Redis cache
193
+
194
+
1. Install Redis if needed: `brew install redis`
195
+
2. Start a local server: `yarn redis:up` (uses the `redis-server` binary on `127.0.0.1:6379`).
196
+
- If you prefer Docker, use `docker run -d --name zenith-redis -p 6379:6379 redis:7-alpine` (requires Docker Desktop to be running).
197
+
3. Point Zenith at Redis:
198
+
199
+
```
200
+
export CACHE_TYPE=redis
201
+
export REDIS_URL=redis://127.0.0.1:6379
202
+
export REDIS_KEY_PREFIX=zenith:
203
+
pnpm zenith --target=build --project=all
204
+
```
205
+
206
+
Stop Redis: `yarn redis:down`.
207
+
208
+
Redis stores cache blobs as binary values keyed by the same paths used for S3/local storage (`zenith:` + `target/layoutHash/projectRoot/...`). Use a dedicated Redis instance or database index in shared environments.
209
+
210
+
### Cache types (usage)
211
+
212
+
| CACHE_TYPE | Where artifacts go | When to use |
213
+
|------------|-------------------|-------------|
214
+
|`local`|`.cache/` on disk (or `LOCAL_CACHE_PATH`) | Solo development, no shared cache needed |
215
+
|`remote`| S3-compatible bucket | CI/CD teams sharing cache across machines |
216
+
|`redis`| Redis server | Fast shared cache when you already run Redis; good for smaller/medium artifacts |
217
+
|`local-first`| Local disk + S3 (read local first) | Dev machines with optional remote fallback |
218
+
|`remote-first`| S3 + local disk (read remote first) | CI agents that also keep a local copy |
219
+
220
+
For `remote`, `local-first`, and `remote-first`, set the S3 variables listed above. For `redis`, set `REDIS_URL` (and optionally `REDIS_KEY_PREFIX`).
221
+
148
222
### Cache format benchmark (local MinIO)
149
223
150
224
After `yarn build` and `yarn minio:up`, with remote S3 env vars set:
0 commit comments