React can be used on both single-page applications (for example create-react-app) and for server-side rendering (for example NextJS). A http status is sent once per http request.
This means that if your app is a single-page application and you first go to /
and then click a link to go to /status
, then you won't make a new http request (the full app is loaded on the initial request to /
) and so you will not get a http status at all when changing the path. If your initial top-level navigation is directly to /status
, then the browser will download the app (like it does when you went to /
in the last example) and a status code will be sent at the same time.
If the status code is 304, then it means that your app has been cached. To deal with this, force your backend to set cache headers on the request for the actual resource (the html entrypoint) which indicate that the response must not be cached.
If you're using server-side rendering, then, depending on the framework, you could trigger the /status
path to be dynamic and require rerendering on the backend every time, in which case you will get a 200 status every time if nothing unforseen happens.
Are you trying to configure a health endpoint for a load balancer or something?