DevHub Docs
Search…
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".
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.
1
<link rel="stylesheet" type="text/css" href="{% asset 'less/backend.css' %}">
Copied!

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.
1
<img src="${asset_url_prefix}/path/goes/here.png">
Copied!

Within templates

When using jinja templates, you can also access this value under the site object
1
<img src="{{ site.asset_url_prefix }}/path/goes/here.png">
Copied!
Last modified 1yr ago