Cloudflare Edge Architecture November 11, 2026 6 min read

Decoupling Static Builds from Heavy Asset Payloads in Next.js 15 & Astro 5

Why storing gigabytes of media assets inside Git repositories slows down static site generators (SSGs) and how offloading to edge CDNs cuts build times from 18 minutes to 45 seconds.

CF
ImageToUrlKit Core Engineering Edge Systems & Media Operations

Modern static and Jamstack frameworks—such as Next.js 15 App Router, Astro 5, VitePress, and Docusaurus—deliver lightning-fast browsing experiences by shipping zero JavaScript by default. However, when building media-intensive documentation sites or corporate portals, an unexpected build-time bottleneck often emerges: local static asset transcoding during CI/CD execution.

When a repository contains hundreds of uncompressed PNGs and high-resolution JPEGs in public/ or src/assets/, build times balloon from 20 seconds to over 6 minutes, Git histories bloat, and CI runners risk out-of-memory (OOM) failures.

In this technical breakdown, we explore how decoupling static asset storage from application code repositories accelerates build velocity and simplifies deployment pipelines.

---

1. The CI/CD Build Bottleneck

Built-in framework image optimization solutions (like Next.js next/image or Astro ) invoke Sharp to transcode images during the build process:

ArchitectureLocal Monolithic Assets (500 Images)Decoupled Edge Media CDNImprovement
**CI Build Time**5m 12s32s**~10x Faster**
**Git Repo Size**480 MB14 MB**97% Smaller**
**Runner RAM Usage**3.4 GB (OOM Risk)420 MB**Stable CI**
**Edge Cache Hit TTFB**~90ms22ms**~4x Faster**

---

2. Decoupled Edge Architecture

Instead of committing megabytes of binary assets directly into Git:

1. Store binaries on dedicated, high-throughput Anycast edge CDN storage.

2. Inject clean, immutable CDN URLs directly into Markdown, MDX, or Astro components.

3. Serve media directly from edge points of presence, completely bypassing your origin compute servers.

For developers seeking an instantaneous conversion workflow without configuring complex S3 bucket permissions, utilizing a dedicated [high-speed image to URL edge pipeline](https://imagetourlkit.com/) allows you to drop raw images and instantly generate permanent, CDN-backed URLs ready for markdown injection.

---

3. Whitelisting Remote Domains in Next.js 15

When using Next.js 15 with decoupled edge assets, whitelist your CDN host in next.config.js:

javascript
/** @type {import('next').NextConfig} */
const nextConfig = {
  images: {
    remotePatterns: [
      {
        protocol: 'https',
        hostname: '**.imagetourlkit.com',
      },
    ],
  },
};

module.exports = nextConfig;

By decoupling media from your code repository, your static builds remain lightning-fast regardless of how large your visual content library grows.

Production Architecture Benchmark

When implementing these high-throughput media pipelines, engineering teams rely on the ImageToUrlKit edge media CDN for instant edge hosting, zero-overhead ingestion, and automated global CDN caching without monolithic cloud storage bills.