> For the complete documentation index, see [llms.txt](https://docs.supervisely.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.supervisely.com/enterprise-edition/advanced-tuning/cdn.md).

# CDN

Supervisely allows you to use CDN services to fetch images and videos in labeling tools to speedup data fetching from remote locations. This guide will help you to configure CND on external services.

### Cloudfront

a). Go to Services → Cloudfront → Distributions → Create distribution

b). Provide the following values:

* "Origin domain" type the domain address of your server that Amazon will use to get the files from. In most cases it will be your "SERVER\_ADDRESS" value from the ".env" file;
* Protocol: Match viewer;
* HTTP port: use the value of "PROXY\_PORT" from the ".env" file;
* Cache key and origin requests;

You can either select "Legacy cache settings" or setup policies to your liking. CachePolicy: "CachingOptimized" OriginPolicy: "AllViewer". Notice Supervisely might require cookies forwarding depending on the configuration.

c). Copy the "Distribution domain name"

```bash
cd $(sudo supervisely where)
```

Set "CDN\_DOMAIN" in ".env" file to the value you've just copied:

```bash
CDN_DOMAIN=someawsdomain.cloudfront.net
```

Create or update `docker-compose.override.yml`:

```yaml
version: '2.4'
services:
  api:
    environment:
      CDN_DOMAIN: ${CDN_DOMAIN}
```

Deploy the changes:

```bash
sudo supervisely up -d api
```

d). Now you can go on and open any Labeling Tool, all the urls will be replaced with CDN domain. If nothing shows up, go back to the Distributions page on AWS and wait for status to change from "Deploying" to the current date.


---

# 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://docs.supervisely.com/enterprise-edition/advanced-tuning/cdn.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.
