Skip to main content

Explore eCDN for B2C Commerce

After completing this unit, you’ll be able to:

  • Describe the purpose of a content delivery network (CDN).
  • List three B2C Commerce CDN solutions.
  • Explain eCDN configuration details.
  • Explain how eCDN differs from eCDN for Staging.
  • List the steps you need to take to use the eCDN with an external CDN.

What’s a Content Delivery Network?

Content delivery means moving online media—such as text and graphics—from its repository to the person who needs to see it. In the B2C Commerce world, that means product or promotion details, including text, photos, diagrams, and video. It’s important to serve that content as fast as possible, to hold a shopper’s interest as they browse.

Shoppers want product and promotion details served fast.

Linda Rosenberg, admin at Cloud Kicks, a high-end sneaker and apparel retailer, needs to ensure that even one sale is not lost because of slow content retrieval.

 Linda Rosenberg, Cloud Kicks admin

She learns that a content delivery network (CDN) is a service that’s used by a content owner for distributing content over the internet, while an embedded CDN (eCDN) is usually owned by the organization to distribute private content over internal networks.

eCDN for Salesforce B2C Commerce is embedded into the B2C Commerce platform and available out of the box. It’s designed to accelerate site speed access and content delivery, resulting in a secure and reliable online shopping experience. Streamlining connections between shoppers and retailers ensures that every B2C Commerce storefront renders content fast and efficiently from whatever device a shopper uses.

Linda is assigned to investigate content delivery networks. Here are the types of content delivery products available for her B2C Commerce storefront.

Product Purpose
Embedded CDN (eCDN) Supports the development and production instances.
eCOD for Staging Supports the staging instance.
External or third-party CDN Use your existing CDN.

A B2C Commerce instance is like a Salesforce org. Multiple instances make up a realm that includes a primary instance group (PIG) and a secondary instance group (SIG). There are nine instances per realm: three for staging, testing, and deployment on the PIG; five sandbox instances for code development on the SIG; and one demo instance.

Domain apex and subdomain name.

The eCDN configuration is organized around zones. A zone represents a domain apex, which is the “root” level of your domain, for example, cloudkicks.com. A hostname is a subdomain of a specific zone (for example, www.cloudkicks.com).

eCDN

Salesforce provides an eCDN for B2C Commerce. Linda starts by considering these configuration details.

Configuration Details
Subdomains and zones Configure subdomains of the same zone on the same B2C Commerce instance, or on different instances of different realms of the same merchant. For example, configure www.cloudkicks.com on the production instance of the US realm, test.cloudkicks.com on the development instance, and eu.cloudkicks.com on the production instance of the EU realm.
Custom hostnames The eCDN for your custom hostnames (subdomains) requires configuration before you can route traffic to B2C Commerce.
Hypertext Transfer Protocol Secure (HTTPS) Enable the Enforce HTTPS setting for all storefronts.
Cookies The eCDN uses various cookies to maximize network resources, manage traffic, and protect sites from malicious traffic. See Understanding the Cloudflare Cookies.
Standards The eCDN also supports Web Application Firewall (WAF) and HTTP Strict Transport Security (HSTS).

Linda configures eCDN in the next unit. Meanwhile, she takes a look at eCDN for staging and how she might integrate with an existing CDN.

eCDN for Staging

Linda plans to use eCDN on her staging instance for testing purposes, so she can mirror production during testing. This requires working with an API, which is a developer task. She turns to Vijay Lahiri, her company’s developer, who is happy to help.

 Vijay Lahiri, Cloud Kicks developer

Vijay uses the CDN Zones APIs to upload customer certificates to test a Salesforce Commerce API (SCAPI) implementation and configures vanity host names for staging instances on eCDN.

With the CDN-API, he can see the zones that he creates. They aren’t visible, however, in Business Manager, which only supports development and production instances.

Vijay uses the CDN Zones component of the Salesforce Commerce API to configure and manage the eCDN zones on staging.

Unit five shows how he does this. Meanwhile, Linda investigates external and third-party CDNs.

External or Third-Party CDNs

If Cloud Kicks already had a CDN, Linda would deploy her CDN (or a reserve proxy) in front of B2C Commerce to improve performance and security, or to provide extra functionality with the existing CDN. She’d do this by specifying the URL prefix used to create the URLs pointing to the CDN.

The CDN uses the Client IP header value to transfer the client’s IP address to enable client IP-based services, such as geo-location. B2C Commerce uses this setting to retrieve the client IP address from a request header instead of the network connection source address. If the request header isn’t provided, B2C Commerce uses the connection source address. If a CDN terminates client requests, B2C Commerce continues to use the client IP header name functionality.

Don’t use these header names, regardless of capitalization or if you replace the dashes with underscores. These are reserved.
  • cf-connecting-ip
  • true-client-ip
  • x-forwarded-for

In this module, we assume you are a Salesforce B2C Commerce admin with the proper permissions to perform these tasks. If you’re not a B2C Commerce admin, that’s OK. Read along to learn how your merchandiser would take these steps in a staging instance. Don’t try to follow our steps in your Trailhead Playground because B2C Commerce isn’t available in the Trailhead Playground.

If you have a development instance of B2C Commerce, you can try out these steps in your instance. If you don’t have a development instance and you’re a customer or partner admin, ask your manager if there is one that you can use.

Here’s how to use your CDN with B2C Commerce Embedded CDN.

  1. Open Business Manager.
  2. Select Site | Merchant Tools | SEO | Customer CDN Settings.
  3. In the Dynamic Content section, enter the Client IP Header Name.
  4. Select Merchant Tools | SEO | Aliases and configure the site name.
  5. Click Save.

CDN settings are instance-specific. They aren’t transferred to other instances via the replication process.

Note

Don’t change these settings if you are using only the embedded CDN that’s included in B2C Commerce.

After defining the Client IP Header Name and site aliases, Linda completes the configuration by configuring her domain name system (DNS) and external third-party proxy. Here’s how to configure a third-party proxy on top of the B2C Commerce platform.

  1. On the third-party proxy:
    • Enter the B2C Commerce instance as the origin server. For example: your-domain.cdn.cloudflare.net where “your-domain” is either the proxy zone commcloud.<zone_name> or  the standard zone customer_domain. Here are some examples.

      Zone Example
      Standard eu.cloudkicks.com. 300 IN CNAME
      eu.cloudkicks.com.cdn.cloudflare.net
      Proxy commcloud.stg-abcd-cloudkicks-com.cc-ecdn.net. 300 IN CNAME
      commcloud.stg-abcd-cloudkicks-com.cc-ecdn.net.cdn.cloudflare.net.

    • Pass the host header (for example, www.storefront.com) back to the eCDN. Note: Don’t send the entire B2C Commerce instance (www.customer.com.cdn.cloudflare.net) back to the eCDN.
    • Configure the client IP header name as specified.
    • Ensure that responses are only cached in the CDN if the origin sends a cache header.
  2. On the DNS, point the DNS entry for your site to your CDN CNAME.

Sensitive Security Feature

Sometimes, the eCDN can try to prevent a distributed denial-of-service (DDoS) attack or an attempt to mitigate an application attack. When this happens, the eCDN security feature might see the third-party proxy as the offending IP address or server. As a result, the eCDN will try to block the third-party server and potentially block more users than expected. To prevent this response, add your stacked proxy to the firewall trusted IP address lists. Here’s how to access the allowlist.

  1. Select Administration | Sites | Embedded CDN Settings.
  2. Click Settings for a zone.
  3. On the Firewall tab, add or edit the trusted IP address lists and specify any third-party proxy IP addresses.

Next Steps

You explored content delivery networks and three ways you can implement one in the B2C Commerce environment. Next, learn how to implement eCDN on a B2C Commerce production or development instance.

Resources

Keep learning for
free!
Sign up for an account to continue.
What’s in it for you?
  • Get personalized recommendations for your career goals
  • Practice your skills with hands-on challenges and quizzes
  • Track and share your progress with employers
  • Connect to mentorship and career opportunities