> For the complete documentation index, see [llms.txt](https://docs.devhub.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devhub.com/hosting-options/cdn-content-delivery-network-support.md).

# CDN (content delivery network) support

Details on how to configure a CDN for serving your static assets and images

### Enabling a CDN URL

Under the Site Settings within the Site Builder you will find a field labeled "Asset URL Prefix".

![](https://825756965-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-L_zivnvKch6re2urR-L%2F-Lu3OQkEdQaSV9Olbk44%2F-Lu3Op2YjfdZWkBmVn_A%2FScreen%20Shot%202019-11-19%20at%208.03.03%20AM.png?alt=media\&token=266abc99-124e-4796-9626-a43b8028965c)

You would enter in this field the base URL of the CDN which will be serving the assets without a trailing slash.

**Example Asset URL Prefix:**`https://yoursite.com.somecdn.net`

This would update any .js, .css or image assets so they are served form the CDN instead of locally from the hosted Site.

`https://yoursite.com.somecdn.net/stat/js/some-file.js`

## Linking to assets

If you need to link to an asset from our platform from within your theme or template, you can use the following template code `{% asset %}` to add that to your page which will automatically handle the CDN references.

```markup
<link rel="stylesheet" type="text/css" href="{% asset 'less/backend.css' %}">
```

## Asset macro

Sometimes the assets can't be included using the jinja above, so you also have access to the asset prefix as a macro.

```markup
<img src="${asset_url_prefix}/path/goes/here.png">
```

## Within templates

When using jinja templates, you can also access this value under the site object

```markup
<img src="{{ site.asset_url_prefix }}/path/goes/here.png">
```
