Use your own content delivery network (CDN) with Salesforce B2C Commerce's embedded CDN to deliver static and dynamic content to your customers. Deploy your CDN (or a reverse proxy) in front of B2C Commerce to improve performance and security, or to provide extra functionality.
Layer your CDN or third-party proxy in front of B2C Commerce. Shopper requests go to your CDN first, then to the embedded CDN, and then to your B2C Commerce instance. To set up this configuration, specify the client IP header and site aliases in Business Manager, and then configure your CDN and DNS.
Which Salesforce Commerce Product Do I Have?
To stack a third-party CDN in front of an eCDN zone created with the CDN Zones API, see CDN Zones in the developer documentation.
-
In Business Manager, click App Launcher
, and then select .
The Customer Content Delivery Network Settings page opens. Customer CDN settings are instance-specific. They aren't transferred to other instances with the Data Replication process. -
In the Dynamic Content section, enter the Client IP Header Name.
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.
- Click Save.
- To configure the site name, select , and configure the site name.
- Click Save.
-
To use an external CDN with B2C Commerce, after you define the Client IP Header
Name and site aliases, complete the configuration on your third-party proxy and
DNS.
-
Enter the B2C Commerce instance as the origin server, for example,
your-domain.cdn.cloudflare.net. -
Pass the host header (for example, www.customer.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 that you entered in step 2.
- Make sure that responses are only cached in the CDN if the origin sends a cache header.
-
Enter the B2C Commerce instance as the origin server, for example,
-
In your DNS, point the DNS entry for your site to your
CDN CNAME.
- Trusted Proxies and eCDN Request Blocking
When you stack a third-party CDN or proxy in front of B2C Commerce eCDN, the eCDN security feature can mistake the proxy for an attacker and block it. Verify trusted proxy traffic so that legitimate requests aren't blocked.