Javascript Translation Caching

There are a number of options on how you can do caching. Translation caching will always be done in the browser for optimal performance. If the browser does not yet have the necessary translations, the SDK will fallback onto one of the following: local cache, CDN or TranslationExchange.

Local Cache

To use your own local cache of translations, you simply need to visit Translation Exchange and generate a snapshot from the snapshots section. Snapshots allow you to download all your application's translations at a given moment. You can create snapshots at any time.

Snapshot create

It may take a few seconds to a few minutes to generate your snapshot, based on the size of your application.

Snapshot info

Once the snapshot is generated, download it and extract it to a public folder accessible by your application. For example, if your application runs at http://localhost/ you can create a folder called cache and make it accessible under http://localhost/cache.

Now you can configure the TML library to use the local cache, by setting the path to your cache.

  cache: {
    path: "/cache"

Content Delivery Network (CDN)

Alternatively, you can let us host your translation cache! We use a power Content Delivery Network distributed across the world.


Translation Exchange Cache

If you decide not to use either one of the above, you can fall back onto the Translation Exchange itself.