Force update of Frontend

Hello everyone.

I have faced with a problem. For my webinar platform, I need to implement a Poll functionality. In a nutshell, a moderator can click a button in the admin panel, and after this, all users on this event have to start the Poll passing. For now, let’s imagine that I have to redirect all of them.

The current idea is to have an endpoint that will return a status of the event, e.g. live, poll, … On the front part, I will implement a script that will ping this endpoint (every 5 seconds) and redirect users if required. To prevent a big load on my system I would like to use Redis, it will cache status and help my system. As an additional idea after the Poll triggers, I will delete the cache for this event and cache the new status.

What do you think about this

P.S. I read about WebSockets, but meh

This is called “short-polling”, and is a fairly common technique. (It used to be extremely common before websockets stabilized as a sufficiently-stable tool.)

Depending upon your deployment environment and the number of concurrent users, you may not even need to wait 5 seconds. Last time I created a short-polling interface, I think it was for about 20 users and they were polling at 1-second intervals.

1 Like