A Drupal website is using external Rest API service.
The problem is that in a rare occasion when the Rest API service loses database or crashes for whatever reason, that causes the Drupal website to slow down.
Drupal uses many API endpoints frequently so when those are unavailable, the website becomes useless.
What would be a reliable or efficient way to check if the API is available prior to each request?
Thanks.