Optimize Netlify build times with caching and AVIF improvements#40
Merged
Conversation
- Add netlify.toml: configure build command (build-ci, skipping redundant clean), publish dir, Node 18, and netlify-plugin-cache to persist _site/img and _site/posts between builds. The srcset/blurry-placeholder plugins already skip files that exist on disk, so cached images are automatically reused on subsequent builds. - Add netlify-plugin-cache to devDependencies - Skip AVIF generation on Netlify deploy-preview and branch-deploy contexts (CONTEXT env var); AVIF is the slowest format and not needed for preview correctness. Returns null early since avif is already in optionalFormats. - Reduce AVIF reductionEffort from 6 (max) to 4 for ~30% faster encoding on production builds - Cache css/main.css read at module level in optimize-html.js to avoid 400+ redundant readFileSync calls per build (one per HTML page) - Extend GitHub Actions cache to include resized image variants (*-320w.*, *-640w.*, *-1280w.*, *-1920w.*) not just .blurred files https://claude.ai/code/session_01HWA86yUVnV9hYpTyXwq21f
✅ Deploy Preview for sijobling ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
11ty | 4a8602a | Apr 08 2026, 02:52 AM |
✅ Deploy Preview for si-jobling ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
clean), publish dir, Node 18, and netlify-plugin-cache to persist
_site/img and _site/posts between builds. The srcset/blurry-placeholder
plugins already skip files that exist on disk, so cached images are
automatically reused on subsequent builds.
(CONTEXT env var); AVIF is the slowest format and not needed for preview
correctness. Returns null early since avif is already in optionalFormats.
on production builds
400+ redundant readFileSync calls per build (one per HTML page)
(-320w., -640w., -1280w., -1920w.) not just .blurred files
https://claude.ai/code/session_01HWA86yUVnV9hYpTyXwq21f