CDN for SPAs
The SPA shell is static. Treat it that way.
SPAs are a small set of static files plus APIs. Hosting the shell in one region makes every new session pay that latency before the app even boots.
Cache hashed bundles with long TTLs. Serve index.html from Cloud CDN with purge on deploy. Keep APIs and auth on the origin.
Why teams use Aptranet
What CDN for SPAs 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.
Boot from a nearby PoP
JS, CSS and fonts load with 30 ms average worldwide latency.
Deploy = purge the shell
index.html picks up new hashed filenames as soon as CI purges it.
APIs remain the app origin
Auth and JSON stay dynamic. The CDN is for the shell and public assets.
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.
- 1Host the production SPA build
Any HTTPS origin that serves the bundled files.
- 2Long-cache hashed assets
Fingerprinted files rarely need purge.
- 3Purge index.html on release
Add purge to the SPA deploy pipeline.
- 4Fallback unknown paths to the shell
Configure origin or hosting rules so client routes serve index.html.
Outcomes
What changes once the hostname is on Aptranet.
- SPA bundles are global
- HTML shells update on deploy
- APIs stay on the origin
- Client-side routes still boot from cache
Keep reading
Related pages
More CDN use cases on the same Cloud CDN footprint.
Frequently Asked Questions
Yes. See the dedicated framework pages for bundler-specific notes.
Prefer build-time config in hashed files. Runtime config JSON can be cached with a short TTL.
Yes. Cache prerendered HTML like any static page and purge on deploy.
Cache the worker file carefully. Purge or version it when the worker must update immediately.
