CDN for Next.js
Put Next.js in front of a global edge, not a single region.
Next.js apps ship hashed static assets plus SSR or ISR HTML. A single origin region makes every image, RSC payload and first-time page view travel that far, even when the output can be reused.
Cache /_next/static aggressively. Cache ISR and anonymous SSR HTML at Cloud CDN with purge on deploy or revalidate. Bypass preview, draft mode and user-specific App Router responses.
Why teams use Aptranet
What CDN for Next.js looks like on this network.
Cloud CDN caches and accelerates eligible content on 210+ points of presence, with Origin Shield when the origin must stay out of the way.
Hashed assets at every PoP
/_next/static and font files are immutable. Serve them from 210+ locations with long TTLs.
ISR and HTML at the edge
Anonymous pages can be cached in Cloud CDN so revalidate events rebuild once, not per region.
Images beside the app
Use Cloud CDN image optimization for public imagery instead of making the Next.js origin resize every variant.
How to set it up
A cutover you can validate before DNS moves.
Create the Cloud CDN configuration, prove it on an Aptranet hostname, then point production DNS when the path looks correct.
- 1Point Cloud CDN at the Next.js origin
Pull the Node, container or hosting origin that serves the app over HTTPS.
- 2Cache static and HTML separately
Long TTL for hashed /_next/static. Shorter TTL plus purge for HTML and RSC payloads that can be shared.
- 3Bypass preview and session routes
Draft mode, preview tokens and authenticated App Router routes must not be cached.
- 4Purge on deploy or revalidate
Invalidate HTML when ISR revalidates or a production deploy goes live.
Outcomes
What changes once the hostname is on Aptranet.
- Next.js static files are cached globally
- Shareable HTML can live at the edge
- Preview and draft mode stay dynamic
- Deploys can purge without waiting on TTL
Keep reading
Related pages
More CDN use cases on the same Cloud CDN footprint.
Frequently Asked Questions
Use Cloud CDN when you host Next.js yourself, want an independent CDN, or run a multi-CDN design in front of the app origin.
Cache only responses that are identical for every anonymous visitor. Personalised RSC payloads must bypass cache.
If middleware sets shopper or session cookies on HTML, bypass cache for those routes or vary only on cache keys you fully control.
You can keep the Next optimizer as origin, or point public images at Cloud CDN transformation instead.
