> ## Documentation Index
> Fetch the complete documentation index at: https://help.the-meridian.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# CDN

The CDN add-on caches your app's static files at Google's edge, in front of every hostname the environment serves: its [default domain](/default-domain), its [custom domains](/custom-domain), and the public files of its [object storage](/storage) when it has some. Merchants load your JavaScript, CSS, fonts and images from a location near them instead of from your app's region, and those requests never reach your app.

The CDN is a paid runtime add-on of its own. It does not need object storage. Enable it from **Hosting → Add-ons → CDN**; the price for your app is shown on the button.

## What gets cached

Only static files are cached: JavaScript, CSS, fonts, images, video, audio and PDF. Pages, API responses and data your app renders for a shop (HTML, JSON, React Router loader data) are never cached, so one merchant's content can't be served to another.

Within static files, your app's own `Cache-Control` header decides:

| Your response sends | At the edge |
| - | - |
| `public, max-age=31536000, immutable` (hashed build assets, which `@react-router/serve` sends for `/assets/*`) | Kept up to a year, and the browser keeps it as long |
| No `Cache-Control` | Kept for an hour |
| `private` or `no-store`, or a `Set-Cookie` header | Never cached |

Anything you don't want cached at all, send with `Cache-Control: private` or `no-store`.

## Purging the cache

After each successful deploy, Meridian clears the environment's cache, so files that keep the same name across releases (anything in `public/`, images your app serves) don't stay stale. Hashed build assets change name with every build and are never stale anyway.

To clear it by hand, for example after replacing a file in storage, use **Purge cache** on the CDN screen. Google applies a purge within a few minutes.

## Public storage files

With [object storage](/storage), your bucket's `public/` files are served at `https://<app>-assets.the-meridian.app` whether or not you have the CDN. With the CDN, that hostname is cached too, and its URL is also injected as `CDN_URL`, the same value as `STORAGE_PUBLIC_URL`.

## Bandwidth

Responses served from the cache still count toward the app's [bandwidth](/bandwith), like the ones your app serves itself.

## Turning it off

Cancelling the CDN stops caching at the end of the billing period. When it ends, the cache is cleared and every hostname is served straight from your app again. Nothing in your app needs to change either way.

<Note>
  The CDN can be enabled once your production environment exists.
</Note>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.