Skip to content

CDN & Caching

How InlineCMS delivers content through CDN and handles cache invalidation.

InlineCMS uses a two-path content delivery strategy:

Visitors → CDN edge (~5ms) → cache miss → API → PostgreSQL
Editors → API directly (bypasses CDN, always sees draft state)
  • Visitors get published content from the CDN edge. On cache miss, the request falls back to the API.
  • Editors always bypass the CDN and fetch directly from the API so they can see draft content.

When content is published, InlineCMS automatically sends a cache purge request to your configured CDN webhook:

Terminal window
POST <CDN_INVALIDATION_URL>
Content-Type: application/json
Authorization: Bearer <CDN_INVALIDATION_SECRET>
{
"projectId": "...",
"path": "/about",
"action": "purge"
}

Set these environment variables on the API:

Terminal window
CDN_INVALIDATION_URL=https://your-cdn-provider.com/purge
CDN_INVALIDATION_SECRET=your-webhook-secret

Or configure in the dashboard under Settings > CDN.

If no CDN is configured, all content is served directly from the API. This works fine for low-traffic sites and development. The SDK automatically falls back to the API when no CDN URL is set.

Use a Cloudflare Worker as the purge webhook that calls the Cloudflare Purge API.

Point CDN_INVALIDATION_URL at Fastly’s Purge API endpoint with your service ID.

Any HTTP endpoint that accepts a POST with the JSON payload above. The CDN invalidation system is provider-agnostic by design.

Was this page helpful? Your feedback goes straight to the docs team.