> For the complete documentation index, see [llms.txt](https://mercure-technologies.gitbook.io/xprem/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mercure-technologies.gitbook.io/xprem/installation-guide/cdn-and-assets-delivery.md).

# CDN & Assets delivery

Each time your app checks for an update, it calls your xprem server and receives a **manifest**: A description of the latest update available on its channel, listing the JavaScript bundle and every asset it needs, each with a URL to download it from.\
The client then fetches whatever it doesn't already have and reassembles the update locally.

That second step is where the bandwidth goes. A manifest is a few kilobytes; the assets behind it can be tens of megabytes, downloaded by every device on every update.

xprem offers several delivery modes. Which ones are available depends on the storage backend you configured:

| Delivery mode                       |  Amazon S3 | S3 Compatible Services | Google Cloud Storage | Azure Blob Storage |
| ----------------------------------- | :--------: | :--------------------: | :------------------: | :----------------: |
| Signed CDN                          | CloudFront |            ✗           |           ✗          |          ✗         |
| Generic CDN                         |      ✅     |            ✅           |           ✅          |          ✅         |
| Pre-signed storage URLs *(default)* |      ✅     |            ✅           |           ✅          |       ✅ (SAS)      |
| Through the server                  |      ✅     |            ✅           |           ✗          |          ✗         |

* **Signed CDN:** assets are served from the edge, and the CDN validates a per-URL signature. Fast, and your bucket stays private.
* **Pre-signed storage URLs:** clients download straight from your bucket using time-limited URLs. No CDN, no extra setup, bucket stays private.
* **Generic CDN:** You put a CDN in front of your bucket and give xprem its hostname. xprem then swaps your storage hostname for the CDN one when it builds asset URLs:

  ```
  ​https://my-bucket.s3.eu-west-3.amazonaws.com/assets/a1b2c3 
       ↓
  https://cdn.acme.org/assets/a1b2c3 ​
  ```

  \
  The path is untouched, only the host changes. Your CDN handles the rest: it caches each asset and pulls from the bucket on a miss. This works with Cloudflare, Fastly, Bunny, Azure Front Door, or anything else that can proxy an origin.

  Requests aren't signed, so the origin must be publicly readable.
* **Through the server (not recommended):** xprem fetches each object and streams it back itself. For providers that can't issue pre-signed URLs, or clients that can't reach your bucket directly. All asset traffic transits through your server.

Configuration is covered in each backend's guide:

* [S3](/xprem/storage/s3-storage.md#asset-delivery)
* [Google Cloud Storage](/xprem/storage/google-cloud-storage.md#configure-storage)
* [Azure Blob Storage](/xprem/storage/azure-blob-storage.md#asset-delivery)

For cloudfront please see: [CloudFront](/xprem/cdn/cloudfront.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://mercure-technologies.gitbook.io/xprem/installation-guide/cdn-and-assets-delivery.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
