cache bundled functions across deploys#116
Merged
Merged
Conversation
|
🔎 Loop QA preview (all-k8s backend): https://pr-116--loop-qa-j63k5x.netlify.app |
bhackett1024
approved these changes
Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
two deploy-time fixes that compound:
cache bundled functions across deploys. actions/cache restores .netlify/functions/, deploy-ci re-stamps the manifest (netlify-cli only trusts it for 2 minutes), and netlify deploy reuses the zips. on a miss, netlify build produces the zips + manifest once (no double bundling) and the cache persists them.
bundle uploadthing instead of shipping its node_modules closure. the global
external_node_modules = ["uploadthing"]made zisi ship uploadthing's entire dependency closure (the effect ecosystem, ~4900 files, 16-24MB) into every one of the 130 function zips - ~2GB per deploy, minutes of hashing + upload. esbuild bundles + treeshakes it fine today (the april commit that externalized it was a combined shotgun fix with the esbuild switch, never separately needed). zips drop ~60%+.changes
external_node_modules = ["uploadthing"]the cache key covers netlify/, scripts/ (guidance.ts inlines scripts/seed-guidance.ts), netlify.toml, lockfile, tsconfig. zisi output is deterministic (verified: bundling the same function twice gives identical sha256), so an exact-key restore is byte-identical to a fresh build. no restore-keys fallback on purpose - a near-miss restore would ship stale function code.
measured on this PR's previews
test plan