Conversation
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
|
Preview URL: https://ea6817dc.preview.developers.cloudflare.com |
|
/bonk Does this work make sense? How did the old static key not break things when we added new assets? |
|
Looking at the changes to Changes reviewed:
This follows GitHub Actions caching best practices:
The change is minimal, targeted, and correctly solves the described problem of redundant asset reprocessing and excessive deploy preview uploads. LGTM. |
Summary
The Astro assets cache is configured with a static, immutable key: key: static
GitHub Actions caches are immutable, once created, a cache entry with a given key is never updated. This means the cache was created once and never refreshed, so changed or new assets are reprocessed on every build. This also caused the deploy preview to re-upload +6,000 assets per run instead of only changed files.
Fix
Replace the static cache key with a content-based key and restore-keys fallback: