CDN for Remix

Serve fingerprinted assets from the edge. Use the response headers from Remix loaders to control whether a document can be shared across requests.

Example cache policy
Public, cacheable resource
/assets/checkout.ab10.js
Bypass shared cache
POST /checkout

Set cache policy for loaders and assets

Cache hashed build assets globally. Cache anonymous document GET responses. Bypass loader output that depends on cookies or session.

Versioned build assets

Hashed JS and CSS from the Remix build are cached with long TTLs.

Public documents from cache

Anonymous content routes can be served from the edge after the first loader run.

Session loaders stay private

Authenticated documents bypass cache so Remix session guarantees hold.

Configuration

Cloud CDN overview
  1. Pull the Remix origin

    Connect the Node or hosting origin that serves the Remix app.

  2. Cache assets and public documents

    Long TTL for hashed files. Conditional cache for anonymous HTML.

  3. Bypass cookie-specific routes

    If a loader varies on session, do not cache that document.

  4. Purge on deploy

    Invalidate HTML when a new Remix release ships.

Operational outcomes

  • Remix static assets are global
  • Public documents can be cached
  • Session routes remain origin-dynamic
  • Deploys purge document HTML

Frequently asked questions

Can I cache loader JSON?

Only when the JSON is identical for every anonymous client. Resource routes with user data must bypass cache.

How should Cache-Control be set?

Let Remix set headers per route, then honour them at Cloud CDN. Add purge for deploys.

Does this work with Remix on Express or other adapters?

Yes. Cloud CDN fronts whichever origin adapter you run.

What about POST actions?

Actions are not cached. Only safe GET document and asset responses are.