/
Using of HTML5 push notifications in progress bars
Using of HTML5 push notifications in progress bars
In-Portal uses AJAX-powered progress bars to perform long lasting operations. Workflow looks like this:
- template with an empty progress bar is shown
- ajax request is made to url that would return a progress %
- progress bar is updated with new % and another ajax request is made
This works pretty fine until you have really long press, that takes up 350+ ajax requests to be executed. Seeing that much ajax requests made web browser go crazy and just drop any upcoming ajax requests.
I'm proposing to change the process to use push notifications this way:
- template with an empty progress bar is shown
- single call to a server is made to subscribe for notification about progress change
- on a server (or even in CLI) calls to change % are made and are sending notifications to all subscribed pages with % updates
With that implemented we'll get following benefits:
- memory limit or website server limits no longer apply, since % updates are made from CLI
- less load on Http Server (e.g. Apache) because % update doesn't create new Apache process each time and increase server load
- probably (not tested) absence of 350+ request being dropped
- no timeouts on ajax request execution on client side, because AJAX requests not used at all here