---
schema_version: "1"
id: 64f257dd8185cb3ae3719958d90c51635b053ea1340413c116d9099804116556
title: Decide which CDN to Use
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/pwa-kit-managed-runtime/guides/decide-on-cdn.md
canonical_url: https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/decide-on-cdn.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 2c158d3d18afca255d6481a3544d32045b11a2f8874e64f02ab453e07cdc7ef4
products:
  - Composable Storefront
  - Salesforce APIs
---
# Decide which CDN to Use

You have three content delivery network (CDN) options to launch and route traffic to your Progressive Web App (PWA) Kit site:

1. (Recommended) Use the Embedded CDN (eCDN), which is provided by Salesforce B2C Commerce. For more information about routing traffic to Managed Runtime using eCDN, see this [guide](https://developer.salesforce.com/docs/commerce/commerce-api/guide/ecdn-rules-for-phased-headless-rollout.html). **eCDN is the recommended option for additional control over security features.**
2. Use the Managed Runtime (MRT) CDN. All new PWA Kit projects use the MRT CDN by default.
3. Use a third-party CDN such as CloudFlare or Akamai.

## CDN Comparison

This table summarizes the key differences between the various CDN options that you can use with your PWA Kit site.

Here are some key points in the table.

- If you have a [hybrid storefront](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/hybrid-implementation.md), stack eCDN or a third party CDN to facilitate traffic between your PWA Kit and SFRA sites.
- Using a third party CDN enables more features but requires more complexity, maintenance, and cost.

<table style="width: 100%; border-collapse: collapse; font-family: Arial, sans-serif; color: #4f4f4f;">
  <thead>
    <tr style="background-color: #f4f4f4; font-weight: bold;">
      <th style="border: 1px solid #ddd; padding: 10px 15px; text-align: left;"></th>
      <th style="border: 1px solid #ddd; padding: 10px 15px; text-align: left;"><b>MRT CDN (default)</b></th>
      <th style="border: 1px solid #ddd; padding: 10px 15px; text-align: left;"><b>eCDN</b></th>
      <th style="border: 1px solid #ddd; padding: 10px 15px; text-align: left;"><b>Third-Party CDN</b></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td style="padding: 10px 15px; font-weight: bold;">Why use it</td>
      <td style="border: 1px solid #ddd; padding: 10px 15px;">
        Use the MRT CDN if:
        <ul style="font-size: 14px; margin-left: 20px;">
          <li>You want low cost to serve, quick time to market, and have limited CDN requirements.</li>
          <li>You need a CDN when working only with <a href="https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/creating-an-on-demand-sandbox.html" style="color: #0066cc;">on-demand sandboxes</a>.</li>
        </ul>
      </td>
      <td style="border: 1px solid #ddd; padding: 10px 15px;">
        Use eCDN if:
        <ul style="font-size: 14px; margin-left: 20px;">
          <li>You want to reduce the complexity of managing multiple systems, which is possible because eCDN is tightly integrated with B2C Commerce.</li>
          <li>You require additional control of web application firewall (WAF) rules available in eCDN.</li>
          <li>You need a CDN on only production, development, and staging environments, but not on sandboxes.</li>
        </ul>
      </td>
      <td style="border: 1px solid #ddd; padding: 10px 15px;">
        Use a third-party CDN if:
        <ul style="font-size: 14px; margin-left: 20px;">
          <li>You have a pre-existing relationship with your CDN vendor of choice, where internal teams are skilled in configuring and managing a CDN.</li>
          <li>You need additional control of CDN features above and beyond what eCDN or Managed Runtime provides.</li>
        </ul>
      </td>
    </tr>
    <tr>
      <td style="padding: 10px 15px; font-weight: bold;">Use cases for which it's required</td>
      <td style="border: 1px solid #ddd; padding: 10px 15px;">Not applicable</td>
      <td colspan="2" style="border: 1px solid #ddd; padding: 10px 15px;">
        eCDN or a third-party CDN is required if either of these use cases applies to your site: <b>a. </b> 
        You have a site that’s built 100% on Composable Storefront with multiple domains served from the same Managed Runtime environment; or <b>b. </b>You have a hybrid storefront with a single domain shared with SFRA.      
      </td>
    </tr>
    <tr>
      <td style="padding: 10px 15px; font-weight: bold;">Use cases for which it's optional</td>
      <td style="border: 1px solid #ddd; padding: 10px 15px;">Not applicable</td>
      <td colspan="2" style="border: 1px solid #ddd; padding: 10px 15px;">
        eCDN or a third-party CDN is optional if you have a site that’s built 100% on Composable Storefront with one domain served from a single Managed Runtime environment.
      </td>
    </tr>
    <tr>
      <td style="padding: 10px 15px; font-weight: bold;">Summary of how to set it up</td>
      <td style="border: 1px solid #ddd; padding: 10px 15px;">
        To set up the MRT CDN:
        <ol style="font-size: 14px; margin-left: 20px;">
          <li>Complete the steps under <a href="https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/launching-your-storefront.html#before-you-begin" style="color: #0066cc;">Before You Begin</a>.</li>
          <li>Under <a href="https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/launching-your-storefront.html#launching-an-environment" style="color: #0066cc;">Launching an Environment</a>, complete steps 1, 2, 3, 4, 5 (option 2), 6 (option 3), and 7.</li>
        </ol>
      </td>
      <td style="border: 1px solid #ddd; padding: 10px 15px;">
        To set up eCDN:
        <ol style="font-size: 14px; margin-left: 20px;">
          <li>Complete the steps under <a href="https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/launching-your-storefront.html#before-you-begin" style="color: #0066cc;">Before You Begin</a>.</li>
          <li>Under <a href="https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/launching-your-storefront.html#launching-an-environment" style="color: #0066cc;">Launching an Environment</a>, complete steps 1, 2, 5 (option 1), 6 (option 2), and 7.</li>
        </ol>
      </td>
      <td style="border: 1px solid #ddd; padding: 10px 15px;">
        To set up a third-party CDN:
        <ol style="font-size: 14px; margin-left: 20px;">
          <li><a href="https://help.salesforce.com/s/articleView?id=cc.b2c_configuring_an_external_cdn.htm&amp;type=5" style="color: #0066cc;">Configure an External CDN or Third-Party Proxy</a>.</li>
          <li>Use your chosen third-party CDN to ensure that URLs are constructed to point to the correct CDN domain and not the MRT domain. Add a dynamic header to incoming requests. To do so, in your third-party CDN, ensure that an x-forwarded-host header exists in requests sent to the MRT origin. Check your CDN vendor documentation for adding a dynamic header to incoming requests.</li>
          <li>Identify the remote IP of each shopper. See <a href="https://help.salesforce.com/s/articleView?id=000391453&type=1" style="color: #0066cc;">Deriving Remote End-User/Client IP Address</a>.</li>
          <li>Follow best practices for bot protection. See <a href="https://developer.salesforce.com/docs/commerce/commerce-solutions/guide/bot-management.html#implementation-best-practices" style="color: #0066cc;">Implementation Best Practices</a> and <a href="https://developer.salesforce.com/docs/commerce/commerce-solutions/guide/bot-mitigation-sk.html" style="color: #0066cc;">Bot Mitigation Best Practices for Flash Sales</a>.</li>
          <li>Configure TLS certificates. Check your CDN vendor documentation for more information.</li>
          <li>Complete the steps under <a href="https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/launching-your-storefront.html#before-you-begin" style="color: #0066cc;">Before You Begin</a>.</li>
          <li>Under <a href="https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/launching-your-storefront.html#launching-an-environment" style="color: #0066cc;">Launching an Environment</a>, complete steps 1, 2, 5 (option 1), 6 (option 1), and 7.</li>
        </ol>
      </td>
    </tr>
  </tbody>
</table>

## See Also

- [Pre-Build and Go-Live Best Practices Checklist](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/pwa-best-practices.md)
- [Launch Your Storefront](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/launching-your-storefront.md)
