Add cache_repodata toggle for github_rpm remotes
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful

Cache generated repodata per replica and rebuild only when the remote's
rpm_metadata fingerprint (count, max id) changes.
This commit is contained in:
2026-10-25 13:16:28 +11:00
parent 9294686ea6
commit 5d50eda58a
9 changed files with 332 additions and 18 deletions
+8
View File
@@ -53,6 +53,14 @@ derived metadata current off the client request path:
~once per `mutable_ttl` regardless of replica count, and the shared `etag`
lets any replica issue the conditional request.
### Repodata cache
Repodata is regenerated from the metadata rows on every request by default. Set
`cache_repodata: true` on the remote to keep the generated `repomd.xml` and its
`primary`/`filelists`/`other` files in memory per replica. Each request checks a
cheap row fingerprint (count + newest id) in the database and rebuilds only when
it moved, so every replica picks up a scan's changes on its next request.
```hcl
# Backend that serves the actual .rpm bytes from github.com.
resource "artifactapi_remote_generic" "github" {