Content Delivery Network #
Duet serves all of its static assets through a Content Delivery Network for better performance and stability. CDN also makes it faster to implement and use our packages in production.
A content delivery network is a system of distributed servers that deliver pages and other static web content to users based on their geographic location, the origin of the webpage, and the content delivery server. Some of the benefits of using Duet’s CDN includes:
- Faster load times for all users.
- Better site performance and shared assets across different apps.
- Scales very rapidly during heavy traffic.
- Minimizes risk of traffic spikes at point of origin, ensuring stability.
- Decreases infrastructure costs due to traffic offloading.
- Faster to get up and running with development work, as teams don’t have to install the packages.
Available assets #
The following packages and all of their static assets (e.g. images, styles and scripts) are available for production usage via Duet CDN:
- Duet Web Components:
- Duet CSS Framework:
- Duet Design Tokens:
- Duet Illustrations:
- Duet Icons:
- Duet Fonts:
URL structure #
Duet Content Delivery Network uses the following URL structure for the hosted Node.js packages:
To fetch e.g. the CSS Framework’s minified stylesheet using the above format, you would write it like:
Please note that Illustrations are the only exception to the above rule as they aren’t versioned. For illustrations, you need use the following URL structure:
- To find URLs for illustrations, see Illustrations documentation.
- To find URLs for icons, see Iconography documentation.
- To find URLs for Webfont imports, see Typography documentation.
- To find URLs for Web Components, see Components documentation.
- To find URLs for CSS Framework, see CSS Framework documentation.
- To find URL for Design Tokens as CSS Custom Properties, keep scrolling down.
Subresource Integrity #
Subresource Integrity is a security feature that enables browsers to verify that resources they fetch from a CDN are delivered without unexpected manipulation. It works by allowing you to provide a cryptographic hash that a fetched resource must match (source: MDN).
Our documentation provides cryptographic hashes for the latest available package versions, but you can also generate these hashes yourself for older versions using e.g. openssl command line tool. To enable SRI verification, use the following tags in the
<head> of your application:
<script type="module" src="https://cdn.duetds.com/api/components/6.8.0/lib/duet/duet.esm.js" integrity="sha384-Zfq/6W2+BlpcxzPPW3KBmFnMt/kp6c8a3Qv4kxzVne2kiawM8xJn43bLH5p1cNjQ" crossorigin="anonymous"></script>
<script nomodule src="https://cdn.duetds.com/api/components/6.8.0/lib/duet/duet.js" integrity="sha384-tMnjay+Jjza4zk7VgrrMR1XNXGYmTi6fNcNP5kVgFumh5Hweu2AxlKJxeqLIdEO3" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdn.duetds.com/api/css/2.0.37/lib/duet.min.css" integrity="sha384-HCyysBnZ5EIw1st8I3EG6DCaottRChl7hYlTqmsS8XzdgQsclbv9Edi5gsco2Wy3" crossorigin="anonymous" />
Design Tokens as CSS Custom Properties:
<link rel="stylesheet" href="https://cdn.duetds.com/api/tokens/3.0.37/lib/tokens.custom-properties.css" integrity="sha384-rxTcztOdY2IJ7Qut98AqRJJY5tXpDexWKN6csXh9raZkxudeSn7Ls9VHTrAC5qrs" crossorigin="anonymous" />
Fonts for LocalTapiola:
<link rel="stylesheet" href="https://cdn.duetds.com/api/fonts/2.0.37/lib/localtapiola.css" integrity="sha384-5JYmtSD7nykpUvSmTW1CHMoBDkBZUpUmG0vuh+NUVtZag3F75Kr7+/JU3J7JV6Wq" crossorigin="anonymous" />
Fonts for Turva:
<link rel="stylesheet" href="https://cdn.duetds.com/api/fonts/2.0.37/lib/turva.css" integrity="sha384-hHdwZODJ+y2QoCpmMYq9dSnwexFN8FO9B9cVru7Y7iy2l3bXKpf/vNfPASXgfKWU" crossorigin="anonymous" />
Available versions #
Duet Content Delivery Network includes versioned releases of the following Node.js packages starting from version number:
If you experience any issues while getting set up with Duet Content Delivery Network, please head over to the Support page for more guidelines and help.