This article is for IT & Networking Specialists using the Global Delivery Network.
Content Delivery Networks (CDN) offer many performance and availability benefits for your website and your end users. CDN technologies are compatible with Smartling's Global Delivery Network (GDN), but there are a few things to keep in mind when using these tools in combination with the GDN.
Using a CDN on Your Source Site
When using a CDN on your origin site, the first decision you must make is whether to set up your GDN site with your CDN server or with your origin server as its source. If you would like to bypass the CDN when the GDN requests source content, you can add the IP or domain of the web server hosting your site as an alternate endpoint.
If you choose to have the GDN set up with your CDN as its source, you should whitelist the GDN server IP addresses. All users visiting your localized site will appear to be coming from the GDN IP addresses. To ensure that the GDN servers do not get blocklisted and that there is no downtime, GDN IP addresses should be whitelisted. For more information, see Whitelisting Global Delivery Network Servers.
Additionally, CDNs may charge fees based on request volume. If you choose to set up your localized site to use your CDN server, you may have an increased number of requests through your CDN.
To ingest content and begin translation, the source content will have to be published on your source site. When using a CDN on your origin site, this often means publishing content long after it was created, finalized, and ready. In many cases, this leads to untranslated content on your localized site, and a delay in the translation process. Consider configuring your GDN site to use an alternate endpoint if you would like to ingest content from your source server (from an IP address or origin domain).
Loading Resources From a CDN Domain
If your site loads resources such as images, CSS, and JavaScript from a CDN domain, there should not be any translatable content coming from the CDN domain. If there are files stored on a CDN domain, they will not pass through the GDN and content will not be ingested and translated unless this domain is also added as a source domain in your GDN project. Additionally, the CDN domain should be configured to allow resources to be requested from the localized domain (Cross-Origin Resource Sharing).
Using a CDN on Your Localized Site
Using a CDN on your localized site can lead to a decreased number of Smartling GDN requests. It is also a great way to keep translated content on your site. When new content is published on your origin site, the translated pages will stay cached by your CDN until the cache is cleared. This will allow you to complete translations of new content and only clear the CDN cache once the new content is completely translated.
Additionally, some CDNs may be configured to remove query string parameters from requests. To troubleshoot issues that may arise, we may use Smartling Editmodes, which rely on query string parameters. Requests with Smartling "editmode" parameters should not return cached responses and always be preserved on the CDN's requests to the GDN.
In cases where you are using a CDN in front of both your localized sites and origin site, requests may pass through the CDN twice. This may cause CDN errors or duplicate headers to be added in some cases, which can be removed by the GDN using custom configuration rules.
The CDN cache will also need to be managed. If there is a new image added to your origin site, the cache will need to be cleared on the localized site for the image to appear. If there are translations published, fixes released, or changes to the Smartling configuration, the CDN cache will have to be cleared. It is also important not to cache any dynamically generated content or user information.
Viewing Localized Domain Caching
You can check if your localized domains are cached by a CDN from the Domain Management page:
- Go to Account Settings > GDN Hub > Manage Domains
- Click the downward arrow on your source domain to view its localized domains
- Under Cache Headers, view browser caching control;
- Set by GDN means no CDN is in use
- CDN in use means caching is controlled by CDN
How to enable CDN Caching on Localized Domains with GDN
To enable CDN caching on the GDN:
- Go to Account Settings > GDN Hub > Manage Domains
- To one of the following;
- On an existing localized domain:
- Click the ellipses > Edit
- Set the Browser Cache Control to CDN in front of Smartling, caching controlled by CDN
- Click Save Domain
- For a new localized domains:
- Create a localized domain with your Solutions Architect
- Set the Browser Cache Control to CDN in front of Smartling, caching controlled by CDN
- Click Save Domain
- On an existing localized domain:
CDN Headers Modified by GDN
When Browser Cache Control to CDN in front of Smartling, caching controlled by CDN
Content Type | CDN Headers |
HTML | 'Last-Modified ', 'Etag ', 'Expires ' and 'Cache-Control: max-age ' headers are cut off; |
JS/JSON |
' " ' |
Tip: If you choose not to use a CDN, set the browser caching to No CDN used; optimized caching for JS/JSON content. This means that a CDN is not in front of the GDN, and headers that control caching (Etag, Last-Modified, Cache-Control) are set by the GDN to ensure the correct loading of localized pages.