Skip to content

Commit 320e00b

Browse files
committed
Document indexed cache purge endpoints
1 parent 238682f commit 320e00b

1 file changed

Lines changed: 25 additions & 1 deletion

File tree

docs/cache-backends.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,31 @@ internal cache implementation.
169169
queries, and bulk path count have explicit limits; paths must start with `/`;
170170
path traversal segments, encoded path separators, encoded dots, backslashes,
171171
control bytes, and malformed host/method/query values are rejected.
172-
Prefix and tag purge need a cache index and remain planned.
172+
`POST /_fluxheim/cache/purge-index` invalidates entries from the bounded cache
173+
index for a whole vhost cache, or for a route cache when `route` /
174+
`x-fluxheim-cache-route` is provided. This is the intended operator command
175+
for full-scope vhost or route invalidation without constructing individual
176+
cache keys.
177+
`POST /_fluxheim/cache/purge-prefix` invalidates indexed entries for a vhost
178+
or route whose normalized request path starts with `path_prefix` / `prefix` /
179+
`x-fluxheim-cache-path-prefix`. Prefix purge requires a non-root prefix such
180+
as `/assets/`; `/` is rejected so complete cache clears stay explicit through
181+
scope purge. Both indexed endpoints accept `limit` /
182+
`x-fluxheim-cache-limit`, default to a bounded batch size, and return
183+
`truncated = true` when more indexed entries remain for the requested scope.
184+
The index is bounded in memory, mirrors disk-tier writes, and is designed for
185+
operational invalidation rather than as a complete filesystem scan.
186+
Wildcard purge and a background disk purger remain planned.
187+
188+
Example admin cache invalidation requests:
189+
190+
```sh
191+
curl -X POST -H "Authorization: Bearer $FLUXHEIM_ADMIN_TOKEN" \
192+
"http://127.0.0.1:9090/_fluxheim/cache/purge-index?vhost=repoheim.eu&limit=500"
193+
194+
curl -X POST -H "Authorization: Bearer $FLUXHEIM_ADMIN_TOKEN" \
195+
"http://127.0.0.1:9090/_fluxheim/cache/purge-prefix?vhost=repoheim.eu&path_prefix=/assets/&limit=500"
196+
```
173197

174198
Example: `cache.memory.max_size_bytes = "1GiB"` with
175199
`cache.max_object_bytes = "32MiB"` plans 32 in-memory object slots.

0 commit comments

Comments
 (0)