Even faster API for faster websites: deliver API & media assets via a CDN

Written by Guillaume Bort in Announcement on May 22,2014

From the early design days, we architectured prismic.io to provide extreme performance for websites and apps using our content API. Our API is designed to be elastically scalable. In addition, one of the key properties allowing us to achieve high performance is that all our API content calls can be cached forever. This is also true for the media assets linked by the prismic.io documents: they can be cached forever as well.

However, when optimizing reponse time, you need to pay careful attention to network delivery delay: the time the result takes to travel from our API servers to your servers/clients. That is particularly true when retrieving newly published changes on your content. Although it amounts to milliseconds, it is not ideal if you call our content API from the client side, whether from a web browser or from a native mobile application: the cache will be done by the client, and will not be shared between all your visitors. And of course, each visitor still have to download the media assets from our servers.

Announcing the experimental CDN feature

Today we are deploying a new experimental feature allowing us to deliver our API and media assets via a global network of edge locations located all over the world in United States, Europe, Asia, South America and Australia.

This means that calls made either from your servers or your visitor's clients will be directed to the closest edge location. Most frequent requests will probably be cached there and served with almost no network latency. For the other ones that wouldn't be cached yet, they will use a faster network up to our server, improving the network latency as well.

This experimental feature is available for repositories in production. To enable a CDN for your repository, an administrator must go to the Settings/API & Security panel and enable it:

It can take up to 1 hour to deploy the CDN to all the edge locations. Once it is ready for your repository, you will get a secondary API entry point URL that you can use instead of the default one. All subsequent calls and linked media assets referenced by this API entry point will also be directed to the CDN if applicable.

This feature is being progressively deployed to more and more repositories. But feel free to ask if it is not available for you yet and you want to give it a try.

Guillaume Bort

Guillaume Bort is the co-founder of prismic.io and created the Play Framework and Zengularity.