Skip to main content

Command Palette

Search for a command to run...

Heartbeat API

Published
1 min read
Heartbeat API
P

Hiya 👋 I'm Pranav. I'm a recent computer science grad who loves punching keys, napping while coding and lifting weights. This space is a collection of my journey of active learning from blogs, books and papers.

[52]

Introduction

The Heartbeat API is a simple server polling API built into WordPress, that allows a client to send periodic signals to a server to indicate that it is active and functioning correctly. This is commonly used in various applications to check the availability and monitor the health of a system or service. It keeps user sessions alive by indicating active usage. The 'heartbeat' comes from its resemblance to a pulse check, providing simple confirmation that the system is 'alive.' The API often returns a simple status like '200 OK.'

The API is stateless (i.e., it does not maintain any state) and simply responds to requests without significant processing. Load balancers usually use Heartbeat APIs to determine if a server instance is healthy and ready to handle requests.

In CI/CD deployment pipelines, a heartbeat check may verify if a new deployment was successful.

More from this blog

Pranav's Place

63 posts