Setup Translation Cache
This article is for Account Owners and Project Managers using the Global Delivery Network.
Smartling offers a translation caching feature to help prevent untranslated content from appearing on your localized sites, called Static Cache. Untranslated content can appear when you publish changes to your source site before the translation process has been completed.
Static Cache allows you to take a snapshot of the current state of your translated pages, which are served to your site visitors. Once new content has been fully translated for a given page, your translation cache will automatically reset, bringing the localized page in sync with your source site.
Static Cache is a good fit for static sites. It may not be a fit for sites with dynamic elements such as a login, booking engine, shopping cart or that are customized based on users (e.g. cookies).
Any assets that are not going through the proxy (loaded from your source site instead of your localized site) will not be cached. By default, CSS files and images will not be cache and any assets larger than 1 MB will not be cached.
Additionally, if your cached assets are not requested for 30 days, the cache for this asset will be cleared. This is done to ensure we do not have outdated content on your site.
Finally, the static cache can prevent new content from appearing on a page that has been cached. It cannot prevent net new pages from appearing on your localized sites.
Contact your Customer Success Manager to discuss if Smartling's Static Cache is a good fit for your site.
Once the caching feature has been enabled for your account:
- From within your Global Delivery Network project, click on Project Settings > Static Cache.
- Click the Bleedthrough Projection toggle to ON.
- Choose to enable caching for any localized domain listed in your project by toggling ON as required.
Once caching has been enabled for a site, you will need to set the cache for each page for each language you support. This happens when a localized page is visited. You can quickly populate the cache by using a crawler, by organic traffic, or manually by browsing each of your translated websites.
From then on, requests to that site will be served from the cache and any changes to your source site will not be reflected on cached pages.
There are two ways to reset the cache for a localized page - automatic and manual:
When all new strings on a page for a particular localized site have reached the published state, the cache for that page will be reset automatically.
You can also append the URL parameter ?smartling_editmode=5 to the end of any localized page URL to use the inline browser tool to manage the cache for a translated page.
How to Tell if a Resource is Cached
There are two ways to tell if a resource is cached:
- Use a Preview Mode. Append the URL parameter ?smartling_editmode=5 to your localized site. At the bottom of your page you will see a dialogue that shows the cache status of the page. This is useful for checking if the HTML of the page is cached.
- View Response Headers. All cached resources will have a response header of X-SL-Cached. If the value of this header is 0 this means that the resource was not served from cache. If the value of this header is 1 this means that the resource was loaded from cache.
If you are looking to optimize performance and page speed, consider using a Content Delivery Network instead of Static Cache.
Lock a Cached Page
A page can be locked in its cached state to preserve a page until it is manually unlocked. Using ?smartling_editmode=5, the "Lock page" checkbox will appear in the cache toolbar at the bottom of the page.