Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,110 of 9,110 pages
About the help in other languages
All help pages

External resources and CDNs

When a design loads anything from another host (fonts, scripts, maps, videos, analytics): the costs in speed, privacy and security policy, the self-hosted alternatives the shipped themes use, consent before third-party…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/designers/theme-design/external-resources-and-cdns.md

On this page

External resources and CDNs

This page is for designers who are tempted to add a <link> or <script> from another host. Each third-party origin costs speed, privacy and a change to the site's security policy. The page answers: when it is worth it and how the shipped themes avoid or contain it.

Contents

  1. The costs
  2. Self-hosting first
  3. When a third party is unavoidable
  4. The security policy

The costs

  • Speed: every new host means a DNS lookup, a TCP connection and a TLS handshake before the first byte. The media design's stylesheet comment records this as the reason it moved its font from a font host to its own fonts/.
  • Privacy: the visitor's address and the page they read go to the third party. In many countries that needs consent before it happens.
  • Availability: if the third party is down or blocked, your design breaks.
  • Security policy: each origin must be added to the site's [ContentSecurityPolicy] Directives[].

Self-hosting first

Instead ofThe shipped way
Google Fonts linkfont files in the design's fonts/, @font-face packed with the CSS (Fonts in a design)
jQuery from a CDNezjsc::jquery with ezjscore.ini [eZJSCore] LoadFromCDN=disabled (default): the local jQuery 4
map tiles straight from the tile serverthe starter theme's osm_proxy module caches map tiles so visitors never contact the tile server (by its README)
icon fonts from a CDNSVG icons in the design or share/icons/

When a third party is unavoidable

Videos, maps with live data, payment widgets, analytics:

  • Ask first. The media design draws a placeholder for a YouTube video and loads the player only after the visitor agrees (exp-youtube-consent.js and .css, texts passed as a JSON block in pagelayout/head/script.tpl), and has a cookie consent script (exp-cookie-consent.js).
  • Load late. Use loading="lazy" on iframes, defer on scripts.
  • Pin and verify. For a script from a CDN, a fixed version URL and a Subresource Integrity hash (integrity=""); the comment above ExternalScripts[] in ezjscore.ini recommends https and integrity for external scripts.

The security policy

Each origin is added to the directive it needs, per siteaccess, for example:

# settings/siteaccess/<site>/site.ini.append.php
[ContentSecurityPolicy]
Directives[frame-src]='self' https://www.youtube-nocookie.com
Directives[img-src]='self' data: blob: https://i.ytimg.com

Keep the list short and documented in your theme's README, so administrators know what to allow. See CSP-safe design.

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x