Main menu

Automatically commit translation files to Loco's CDN

This feature is currently in Beta. We welcome your feedback.

Adding our CDN as a deployment host

  • Open the developer tools modal from any project view where you see the :wrench icon:
  • Switch to the "Deployments" tab, and click the "New host" link
  • Choose "Loco CDN", and confirm with "Add host".

Nothing is deployed yet. You've just created a destination for publishing files. See general instructions on publishing files to a host.

CDN Options:

  • CDN Path:
    This is the root of all your CDN deployments for this host. You can't change the directory path, but you can define sub-directories for the files you deploy here.

  • Cache expiry:
    The TTL (in seconds) defines how long the CDN will serve deployed files before fetching fresh versions. See caching.

  • Other options are common to all deployment hosts.

Cross-origin resource sharing (CORS)

Our CDN has an open CORS policy. It will respond to any valid CORS request with:

access-control-allow-origin: *

This means you can access deployed files from a web application on any domain.

Security

Important: No authentication is required to download your files from our CDN.

The root path is designed to be "undiscoverable" and file iteration is not possible, but it's important to know that anyone in possession of a URL has read access to the file, and can potentially guess the names of other files at the same location.

As noted above, the CORS policy is open. This means anyone in possession of a URL can load it into their web application too. It's not currently possible to restrict individual files to specific origins.

Caching

A CDN will be much faster for your site visitors if you allow caching for a suitable time period. We recommend you choose a value in line with how often you plan to update your deployments. e.g. If you publish files (at most) every hour, it would make sense to allow a one hour cache.

Deploying files as soon as translations are updated would mean fresher data for more people, but would mean having to set a very short expiry in order for the edge caches to reflect the changes. A shorter expiry will mean more frequent origin requests. i.e. more visitors experiencing slower downloads.

Permanence

Files deployed to our CDN will persist at their public URLs until you delete the deployment. This also occurs when you delete the project, or the host configuration. Note that there will be a delay before deleted files are removed completely from all edge caches.

You can't delete individual files by modifying a deployment. You can only overwrite them, or add to the set. If you want to prune redundant files, you can delete the deployment and simply add it back again. After an hour or so, any files not in the new deployment will be removed from the CDN.

See also

Last updated by