Bring your own CDN

You can have Iframely iFrame helpers served via your own content delivery network. Say, Amazon CloudFront, CloudFlare or others. Enterprise plan requires a custom CDN provided. We will reach out if that becomes an issue.

To have it configured, point your CDN distribution to our servers and give the address of your distribution to our support team. We will verify your setup and add your CDN to your account options.

After that, Iframely will start returning embed codes with your own CDN proxy that fetches white-labeled iFrames from our cloud and delivers it to your users.

If you &omit_script and add embed.js to your pages yourself, please load it off your custom CDN as well.

You may also opt to self-host embed.js script. It is available on GitHub and NPM.

Configure Amazon CloudFront

Create a new CloudFront distribution. For it, configure the following general settings that are required by Iframely:

  • Delivery method: web.
  • Origin domain name:
  • Origin path: leave empty.
  • Forward headers: whitelist, add header CloudFront-Forwarded-Proto. Otherwise, we won't be able to tell if a request comes via SSL or not.
  • Object caching: use origin cache headers.
  • Forward Query Strings: yes.
  • All the other fields can be left with default values.

Basically, you're mapping to the root of our domain, and let Iframely orchestrate CloudFront's cache. You may create custom CNAME subdomain from your main domain that points to CloudFront distribution if you like, but don't forget to get a custom SSL certificate from Amazon in that case as well.

Configure CloudFlare

You can either create a subdomain for your existing CloudFlare site, or register a custom root-level domain and add it to CloudFlare separately.

  • In DNS, create subdomain as the CNAME record and point it to You can safely use CNAME Flattening setting to make DNS resolution a bit faster for your users.
  • In Page Rules, create a rule for* (use your own domain) and add these two settings:

    • Cache Level: Cache Everything - it makes CloudFlare cache text/html resources too. Minimum cache TTL will depend on your CloudFlare plan.
    • SSL level: Full - Iframely needs to know that requests come over SSL.

Iframely needs all query string parameters. If you need other Cache Control values elsewhere on your domain, then you will not be able to set CDN as subdomain. You will have to register a separate domain for your custom CDN with Iframely, as our iFrames don't work without query strings.

  • Don't forget to activate SSL in Crypto section if you need HTTPs connections.

Contact us to finalize

Once you've configured your CDN, send us your CDN domain name. We will verify that everything is right and configure it as domain name for your Iframely iFrames.

Previous article: Allow origins
Next article: What URLs to send