#118 made the cargo registry cacheable by teaching CacheService a base outside the checkout. On a large Rust consumer it still misses every run — the full cargo fetch --locked download runs each time, ~1.0 GB and ~40s, and the log is byte-identical run to run.
Evidence
The install's exec logs are identical across a dozen consecutive executions (exec-5.ndjson, 41,299 B of Downloaded <crate> lines). composeRestoreOr runs onMiss only on a miss or a restore error, so one of the two is happening on every attempt — and it has been happening since #118 deployed, which rules out "the first run pays and the rest hit".
The suspicion, stated as a suspicion
The archive is 113.9 MB for that repo (registry/cache 113 MB + registry/index 44 MB, gzipped). The restore path does:
await box.writeFile(TARBALL_PATH, archive.body);
— streaming a 114 MB body from R2 into the container through the Worker, against a 128 MB isolate memory budget. That is close enough to the ceiling to be worth ruling in or out before anything else, and it would explain why a smaller consumer's node_modules cache works while this one does not.
Not confirmed: restore catches its own failure into CacheError and composeRestoreOr treats it as a miss, so the failure is invisible from the consumer side. The first fix is to make it visible — log the restore error at warn with its phase and size, so the next run says which of the two it is instead of leaving it to be inferred.
Why it matters more than 40 seconds
It is 40s and 1 GB today, on a run that shares one container. The moment stages get their own containers (#131), the same download is paid N times.
#118 made the cargo registry cacheable by teaching
CacheServiceabaseoutside the checkout. On a large Rust consumer it still misses every run — the fullcargo fetch --lockeddownload runs each time, ~1.0 GB and ~40s, and the log is byte-identical run to run.Evidence
The install's exec logs are identical across a dozen consecutive executions (
exec-5.ndjson, 41,299 B ofDownloaded <crate>lines).composeRestoreOrrunsonMissonly on a miss or a restore error, so one of the two is happening on every attempt — and it has been happening since #118 deployed, which rules out "the first run pays and the rest hit".The suspicion, stated as a suspicion
The archive is 113.9 MB for that repo (
registry/cache113 MB +registry/index44 MB, gzipped). The restore path does:— streaming a 114 MB body from R2 into the container through the Worker, against a 128 MB isolate memory budget. That is close enough to the ceiling to be worth ruling in or out before anything else, and it would explain why a smaller consumer's
node_modulescache works while this one does not.Not confirmed:
restorecatches its own failure intoCacheErrorandcomposeRestoreOrtreats it as a miss, so the failure is invisible from the consumer side. The first fix is to make it visible — log the restore error atwarnwith its phase and size, so the next run says which of the two it is instead of leaving it to be inferred.Why it matters more than 40 seconds
It is 40s and 1 GB today, on a run that shares one container. The moment stages get their own containers (#131), the same download is paid N times.