Connection Loss Between Frontend and Database

Helle everyone,

I am reaching out as a user to seek assistance with a problem in my application. Here’s the context:

I have developed an application using, where a frontend page displays either an image or a video player based on a data field from my database. This data is subject to real-time updates from a backend page.

However, in certain situations, such as when the user is on a train with unstable Wi-Fi or behind a client’s firewall, the frontend application loses its connection to the database afteter a short time (30 seconds). This results in data not updating until the user refreshes the page, which is not an ideal user experience.

I suspect that this issue is related to the WebSocket connection between the application and the database. I would like to establish a method to check if the connection is still active and recreate it automatically if it’s lost to ensure a smooth user experience.

I’m seeking your guidance on how to set up a robust and reliable connection management, as well as mechanisms for detecting disconnections and automatic reconnection within the environment.

Thank you,