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. Use the Managed Runtime (MRT) CDN. All new PWA Kit projects use the MRT CDN by default.
  2. Use the Embedded CDN (eCDN), provided by Salesforce Commerce Cloud. For more information about routing traffic to Managed Runtime using eCDN, see this guide.
  3. Use a third-party CDN such as CloudFlare or Akamai.

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, 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.
MRT CDN (default) eCDN Third-Party CDN
Why use it Use the MRT CDN if:
  • You want low cost to serve, quick time to market, and have limited CDN requirements.
  • You need a CDN when working only with on-demand sandboxes.
Use eCDN if:
  • You want to reduce the complexity of managing multiple systems, which is possible because eCDN is tightly integrated with B2C Commerce.
  • You require additional control of web application firewall (WAF) rules available in eCDN.
  • You need a CDN on only production, development, and staging environments, but not on sandboxes.
Use a third-party CDN if:
  • You have a pre-existing relationship with your CDN vendor of choice, where internal teams are skilled in configuring and managing a CDN.
  • You need additional control of CDN features above and beyond what eCDN or Managed Runtime provides.
Use cases for which it's required Not applicable eCDN or a third-party CDN is required if either of these use cases applies to your site: a. You have a site that’s built 100% on Composable Storefront with multiple domains served from the same Managed Runtime environment; or b. You have a hybrid storefront with a single domain shared with SFRA.
Use cases for which it's optional Not applicable 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.
Summary of how to set it up To set up the MRT CDN:
  1. Complete the steps under Before You Begin.
  2. Under Launching an Environment, complete steps 1, 2, 3, 4, 5 (option 2), 6 (option 3), and 7.
To set up eCDN:
  1. Complete the steps under Before You Begin.
  2. Under Launching an Environment, complete steps 1, 2, 5 (option 1), 6 (option 2), and 7.
To set up a third-party CDN:
  1. Configure an External CDN or Third-Party Proxy.
  2. 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.
  3. Identify the remote IP of each shopper. See Deriving Remote End-User/Client IP Address.
  4. Follow best practices for bot protection. See Implementation Best Practices and Bot Mitigation Best Practices for Flash Sales.
  5. Configure TLS certificates. Check your CDN vendor documentation for more information.
  6. Complete the steps under Before You Begin.
  7. Under Launching an Environment, complete steps 1, 2, 5 (option 1), 6 (option 1), and 7.