CDN for Vue

Cache built Vue assets by their versioned filenames. Configure the origin to serve the application shell for client-side routes and handle API paths separately.

Example release policy
Versioned resource
/assets/app.5bdc.js
Refresh on publication
/index.html

Publish Vue assets with a route fallback

Pull the Vue dist output through Cloud CDN. Long-cache hashed assets, purge index.html on deploy, and keep API traffic dynamic.

Vite bundles at the edge

A hashed filename lets the edge reuse the asset until a later build introduces a new URL.

Deploy-time HTML purge

The Vue HTML shell updates as soon as CI purges it.

Same network as Cloud DNS

Resolve the Vue hostname on Anycast DNS and deliver on the same footprint.

Configuration

Cloud CDN overview
  1. Host the Vue dist directory

    Use any HTTPS origin Cloud CDN can pull.

  2. Cache hashed files longer

    Fingerprinted Vite assets get long TTLs.

  3. Purge index.html on release

    Add a purge step to the Vue deploy pipeline.

  4. Map TLS and DNS

    Attach the production hostname after a test pass.

Operational outcomes

  • Vue bundles are cached globally
  • HTML shells purge on deploy
  • API calls remain dynamic
  • Lazy chunks load from a nearby PoP

Frequently asked questions

Does this work with Vue SSR?

Yes. Cache shareable SSR HTML. See CDN for Nuxt when you use the Nuxt framework.

Can I use this with Vite preview origins?

Use a production origin, not a development preview server, as the CDN origin.

How should I cache locale files?

Hashed locale JSON can use long TTLs. Purge unhashed i18n files on deploy.

Are source maps cached too?

Avoid exposing source maps on the public distribution unless you intend them to be public.