<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-i-made-this-astro-site-build-faster-and-cut-its-deploy-size-x7vte3lsv" -->

---
title: How I made this Astro site build faster and cut its...
description: A developer shares how they optimized a 4,000-page Astro static site, cutting build time by 25% and deploy artifact size by 34%. Key changes included enabling...
canonical: https://daily.dev/posts/how-i-made-this-astro-site-build-faster-and-cut-its-deploy-size-x7vte3lsv
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How I made this Astro site build faster and cut its deploy size | daily.dev
og:description: A developer shares how they optimized a 4,000-page Astro static site, cutting build time by 25% and deploy artifact size by 34%. Key changes included enabling...
og:url: https://daily.dev/posts/how-i-made-this-astro-site-build-faster-and-cut-its-deploy-size-x7vte3lsv
og:image: https://api.daily.dev/og/posts/X7vtE3lsv.png
og:image:alt: How I made this Astro site build faster and cut its deploy size
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How I made this Astro site build faster and cut its deploy size

**[Flavio Copes](https://daily.dev/sources/flaviocopes)** · 6 min read · 1 upvotes · 1 comments

## Summary

A developer shares how they optimized a 4,000-page Astro static site, cutting build time by 25% and deploy artifact size by 34%. Key changes included enabling build concurrency (set to 2), eliminating redundant sort operations during route generation, replacing per-post Open Graph image generation with a shared branded image for most posts (reducing OG images from 2,286 to 362), and moving 198 MB of PDF/EPUB downloads to Cloudflare R2 instead of bundling them in every deploy. The post emphasizes profiling first and questioning whether every generated file is truly necessary.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://flaviocopes.com/optimize-astro-build-deploy-time>

## Questions this post answers

### How do I speed up Astro static site builds with build.concurrency?

Setting build.concurrency to 2 in astro.config lets Astro render two pages simultaneously instead of one at a time, which reduced a warm build from 16.6 seconds to about 12.5 seconds on a 4,000-page site. Testing concurrency of 4 was slightly slower on that project, so the recommendation is to benchmark both 2 and 4 rather than maxing out available CPU cores.

_daily.dev surfaces practical tuning notes like this for developers optimizing their own Astro build pipelines._

### How can I reduce the deploy artifact size of a large Astro site?

Disabling per-post Open Graph image generation and moving large static downloads out of the public directory into object storage cut a deploy artifact from about 897 MB to 591 MB, a 34% reduction. Sharing one 42 KB branded OG image across blog posts instead of generating 2,286 unique images saved about 111 MB, and moving 157 PDF/EPUB files to Cloudflare R2 removed another 198 MB from every deploy.

_Developers wrestling with bloated deploy artifacts can track build-optimization techniques like this on daily.dev._

### Should every blog post have a unique generated Open Graph image?

No, for a site with thousands of posts it can make more sense to share a single branded social image rather than generate one per post. Reducing unique OG image generation from 2,286 images down to 362 (keeping unique cards only for courses, tools, ebooks, and topic pages) shrank the OG image directory from 129 MB to 18 MB with no loss of value for the pages that benefit most from custom titles.

_Weighing per-page image generation against shared assets is exactly the kind of tradeoff developers follow via daily.dev._

## Community discussion

Top comments from developers on daily.dev.

**@rizzdev** · 0 upvotes

> Yea the concurrency dial is the fun pass and collapsing unique og cards plus parking the pdfs on r2 is the part that actually paid. Profile then ask if every file still belongs has always been the whole game. Deleting the feature you already optimized is the unglamorous half people keep skipping

## Similar posts on daily.dev

- [My blog got popular, and my bandwidth exploded to ~300GB in just 10 days](https://daily.dev/posts/my-blog-got-popular-and-my-bandwidth-exploded-to-300gb-in-just-10-days-nflugkjyl) · Neciu Dan · 1 upvotes · 0 comments
- [How I generate an Open Graph image for every post](https://daily.dev/posts/how-i-generate-an-open-graph-image-for-every-post-fouqece4o) · Flavio Copes · 1 upvotes · 0 comments
- [Four things that made my Eleventy website faster without removing the fun](https://daily.dev/posts/four-things-that-made-my-eleventy-website-faster-without-removing-the-fun-5pnqlr22o) · Blogging and all that Malarkey · 2 upvotes · 0 comments
- [Affordable and Fast Migration](https://daily.dev/posts/affordable-and-fast-migration-4apsnn2pl) · Astro · 46 upvotes · 5 comments

---

Tags: [#webdev](https://daily.dev/tags/webdev), [#astro](https://daily.dev/tags/astro)

[View this post on daily.dev](https://daily.dev/posts/how-i-made-this-astro-site-build-faster-and-cut-its-deploy-size-x7vte3lsv)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How I made this Astro site build faster and cut its deploy size","url":"https://daily.dev/posts/how-i-made-this-astro-site-build-faster-and-cut-its-deploy-size-x7vte3lsv","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-i-made-this-astro-site-build-faster-and-cut-its-deploy-size-x7vte3lsv"},"datePublished":"2026-08-03T10:29:02.956Z","dateModified":"2026-09-14T07:52:35.142Z","description":"A developer shares how they optimized a 4,000-page Astro static site, cutting build time by 25% and deploy artifact size by 34%. Key changes included enabling...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/7219243bb6b6113ecc90bd933965a4ef?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/7219243bb6b6113ecc90bd933965a4ef?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Flavio Copes","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Flavio Copes","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/1f2dbd275797411bbd37bfdaaf0951a9","url":"https://daily.dev/sources/flaviocopes"},"commentCount":1,"discussionUrl":"https://daily.dev/posts/how-i-made-this-astro-site-build-faster-and-cut-its-deploy-size-x7vte3lsv","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"keywords":"webdev,astro","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Flavio Copes","item":"https://daily.dev/sources/flaviocopes"},{"@type":"ListItem","position":3,"name":"How I made this Astro site build faster and cut its deploy size"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/how-i-made-this-astro-site-build-faster-and-cut-its-deploy-size-x7vte3lsv","comment":[{"@type":"Comment","text":"Yea the concurrency dial is the fun pass and collapsing unique og cards plus parking the pdfs on r2 is the part that actually paid. Profile then ask if every file still belongs has always been the whole game. Deleting the feature you already optimized is the unglamorous half people keep skipping","datePublished":"2026-08-04T00:55:43.769Z","url":"https://daily.dev/posts/X7vtE3lsv#c-hxKQC5k5U","author":{"@type":"Person","name":"Andrew","url":"https://daily.dev/rizzdev","image":"https://media.daily.dev/image/upload/s--35vRfXAA--/f_auto/v1785413727/avatars/avatar_fQ7ttCKtPuu6tDvcgQXv5?_a=BAMAMicg0"}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/how-i-made-this-astro-site-build-faster-and-cut-its-deploy-size-x7vte3lsv#faq","mainEntity":[{"@type":"Question","name":"How do I speed up Astro static site builds with build.concurrency?","acceptedAnswer":{"@type":"Answer","text":"Setting build.concurrency to 2 in astro.config lets Astro render two pages simultaneously instead of one at a time, which reduced a warm build from 16.6 seconds to about 12.5 seconds on a 4,000-page site. Testing concurrency of 4 was slightly slower on that project, so the recommendation is to benchmark both 2 and 4 rather than maxing out available CPU cores. daily.dev surfaces practical tuning notes like this for developers optimizing their own Astro build pipelines."}},{"@type":"Question","name":"How can I reduce the deploy artifact size of a large Astro site?","acceptedAnswer":{"@type":"Answer","text":"Disabling per-post Open Graph image generation and moving large static downloads out of the public directory into object storage cut a deploy artifact from about 897 MB to 591 MB, a 34% reduction. Sharing one 42 KB branded OG image across blog posts instead of generating 2,286 unique images saved about 111 MB, and moving 157 PDF/EPUB files to Cloudflare R2 removed another 198 MB from every deploy. Developers wrestling with bloated deploy artifacts can track build-optimization techniques like this on daily.dev."}},{"@type":"Question","name":"Should every blog post have a unique generated Open Graph image?","acceptedAnswer":{"@type":"Answer","text":"No, for a site with thousands of posts it can make more sense to share a single branded social image rather than generate one per post. Reducing unique OG image generation from 2,286 images down to 362 (keeping unique cards only for courses, tools, ebooks, and topic pages) shrank the OG image directory from 129 MB to 18 MB with no loss of value for the pages that benefit most from custom titles. Weighing per-page image generation against shared assets is exactly the kind of tradeoff developers follow via daily.dev."}}]}
```

