CDN for Strapi

Serve public uploads and published API responses through Cloud CDN. Exclude draft previews and authenticated endpoints, and purge changed URLs when content is published.

Example cache policy
Public, cacheable resource
/uploads/lookbook.webp
Bypass shared cache
/admin/

Cache published Strapi responses

Cache the uploads directory and eligible public API GETs at Cloud CDN. Put the front end on the same edge. Keep Strapi admin and mutations on the origin.

Uploads delivered globally

Media library files are cached and can be transformed per front-end layout.

Public API GETs at the edge

A shared public API response can be reused without running the same read against Strapi.

Admin stays private

Strapi admin and write APIs are not cached and need not be publicly exposed.

Configuration

Cloud CDN overview
  1. Put media on Cloud CDN

    Use the distribution as the public uploads hostname.

  2. Cache safe API GETs

    Set TTLs for public content types. Bypass authenticated and mutation routes.

  3. Purge on publish

    Invalidate media URLs and content endpoints when editors publish.

  4. Front the website too

    Point the Next.js, Nuxt or static front end at the same edge network.

Operational outcomes

  • Strapi uploads are served from the edge
  • Public read APIs can be cached
  • Admin and writes remain on origin
  • Front-end assets share the same CDN

Frequently asked questions

Can I cache GraphQL?

Cache GET-style or persisted queries that are truly public. Do not cache requests that include draft or user-specific data.

How should I handle draft content?

Draft preview must bypass cache. Only published content should be eligible.

Does this work with S3 uploads?

Yes. Use the object-store hostname as an origin, or pull through Strapi and cache the public URL at Cloud CDN.

Can token authentication protect media?

Yes. Cloud CDN supports secure token authentication for paths that should not be world-readable.