ADAM DJ BRETT

Home / Blog / How I fixed an 11ty performance error that caused my build time to be seven minutes

Inspired by the 11tymeetup, I decided to add a blogroll. I followed the suggestions in various tutorials; however, I forgot to include 11ty fetch. Satisfied, I ran my build, and I was horrified when my build time was a whopping 7 minutes!!!

What changed #

Knowing I needed to make immediate changes to make the site leaner and faster, I made the following changes using the fetch plugin and Netlify's persistent cache across deploys. It wasn't until halfway through making changes that I started writing down the changes to remember in case I make this mistake again in the future.

  1. Faster blogroll – Rewrote the blogroll data loader to use Eleventy Fetch so RSS/Atom responses are cached to .cache/blogroll. The fetcher now logs how long it takes to hydrate the list and skips network calls during FAST_BUILD=true runs.
  2. Cache persistence – Enabled netlify-plugin-cache in netlify.toml so deploys reuse the .cache directory. No more re-downloading dozens of feeds on every publish.
  3. Node 22 + File polyfill – Bumped the toolchain to Node 22, added an .nvmrc.
  4. Thanks to Raymond Camden's posts on Eleventy Fetch, I realized my approach to 11ty fetch was far too hacky, and I needed something faster and lightweight, so I followed his recommendations.
  5. Order of Build Operations – Tag archive generation now skips the blogroll, minification and purgeCSS now happen before pagefind.app.

These changes brought my build time down from the horrific high of seven minutes to 1.6 seconds on my machine and 37 seconds on Netlify.

Having made these changes, I realized that I still had one more change to make, and that is to make sure my sitmap, feed, and tag collections exclude /blogroll/ and feed endpoints. I did this by making sure the sitemap template ignores pages whose permalink is false and this keeps the invalid URLs at bay.

Other changes #

I also made some tweaks to speed up my local development.

Next Steps #

If you are a newbie to Elveventy like me, I hope this is helpful but mostly this post is for future me.

Tags : 11ty indieweb performance website

Previous

Announcing a new 11ty Shortlink and QR Code Generator purl.im

using the #indieweb for shortlinks and qr codes