I need to create a system where I can monitor a specific request status from the server side. What is the most efficient method to achieve this without repeatedly sending ajax requests at predefined intervals?
One idea I have is to send an ajax request to the server every 5 seconds to check the status until it turns true. Once the status changes, I will stop the polling and switch to a different screen. Is this the best approach for this task, or is there a better alternative?
What would be the most practical way to implement this feature?