When my team at a Swedish construction company needed a new website, we decided to go with Gatsby for the frontend and Express for serving pre-built pages. Here's what we learned building totalbyggarna.se — a site with 2000+ pages.
Why Gatsby for a Construction Site?
You might wonder why a construction company needs a static site generator. The answer is SEO. We needed to rank for thousands of location-based keywords across Stockholm and Nynäshamn.
Gatsby's build-time rendering gave us:
- Fast page loads — sub-second on mobile
- Perfect Lighthouse scores — consistently 95+ across all metrics
-
Programmatic page generation —
gatsby-node.jscreates pages from data
The Architecture
Gatsby (build) → static HTML in /public → Express server → Railway hosting
↑
Cloudflare CDN + SSL
We pre-build everything with Gatsby, then serve the static files through a lightweight Express server (serve-prebuilt.js). This approach means:
- Zero server-side rendering at request time — just file serving
- Instant deploys — push to GitHub, Railway auto-deploys
- Easy redirects — Express handles 301s for SEO migrations
Handling 2000+ Pages
The biggest challenge was build time. With 2000+ pages, Gatsby builds took a while. Our solution:
- Incremental builds where possible
- Pre-built HTML editing for quick content updates (skip full rebuild)
-
Trailing slash consistency —
trailingSlash: 'always'in gatsby-config
SEO Results
After launching, we saw:
- DR 18 (up from 0) in 3 months
- 4,200 monthly organic visits
- Health Score 100% on Ahrefs site audit
The combination of fast static pages + proper technical SEO + location-based content strategy worked well for a local construction business.
Key Takeaways
- Static site generators aren't just for blogs — they work great for business sites with many pages
- Pre-building HTML and serving through Express is simpler than SSR
- Cloudflare in front of Railway gives you the best of both worlds
- Don't underestimate the SEO value of fast page loads
If you're building a website for a local service business, consider this stack. Check out the result at totalbyggarna.se — a Swedish construction company site running on Gatsby + Express.
Have you built business websites with Gatsby or similar SSGs? I'd love to hear about your experience in the comments!
Top comments (0)