Contentful logo

Contentful Community

In case Contentful API goes down, what is the best way to handle this?

Worse case scenario - is there any chance that Contentful’s content delivery API will go down and not be able to return any data? If so, what are some things we can do to prevent outages in our own services that rely completely on Contentful to display content?

Hi @jdeng,

I recommend looking into an additional cache layer solution such as Cloudflare. When implemented, most of the responses to HTTP requests will be delivered from Cloudflare cache instead of your website, which by itself will already offer some degree of tolerance for short Delivery API outages.

Ideally your front-end application should have some kind of check if the Contentful client is able to connect to Delivery API. In the event of connection failure, it should halt the application gracefully and return a relevant HTTP response code. Cloudflare can display a version of your website from cache even when your site is down.

1 Like