Skip to content

Optimize Netlify build times with caching and AVIF improvements#40

Merged
si merged 1 commit intomainfrom
claude/optimize-netlify-builds-0wucX
Apr 8, 2026
Merged

Optimize Netlify build times with caching and AVIF improvements#40
si merged 1 commit intomainfrom
claude/optimize-netlify-builds-0wucX

Conversation

@si
Copy link
Copy Markdown
Owner

@si si commented Apr 8, 2026

  • 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

- 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
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 8, 2026

Deploy Preview for sijobling ready!

Name Link
🔨 Latest commit 4a8602a
🔍 Latest deploy log https://app.netlify.com/projects/sijobling/deploys/69d6084ff7f848000899a5c9
😎 Deploy Preview https://deploy-preview-40--sijobling.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
11ty 4a8602a Apr 08 2026, 02:52 AM

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 8, 2026

Deploy Preview for si-jobling ready!

Name Link
🔨 Latest commit 4a8602a
🔍 Latest deploy log https://app.netlify.com/projects/si-jobling/deploys/69d6084f0d69f70008e99035
😎 Deploy Preview https://deploy-preview-40--si-jobling.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@si si merged commit 642584c into main Apr 8, 2026
4 of 6 checks passed
@si si deleted the claude/optimize-netlify-builds-0wucX branch April 8, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants