[edit: I am using Chrome 49.0.2623.112 m (64-bit) with default settings and HTTPS, but the issue occurred before the switch.]
My application utilizes web workers to handle AJAX polling. While this may not provide a significant performance boost, it does enhance the application's structure and could offer future benefits.
To monitor the XHR request frequency, I added a console logging line to the worker. In Chrome, when duplicate log entries appear, the Inspector consolidates them and displays the count.
While viewing the page, I notice in the console: (52) XHR invoked
If the page is active, the number increases every 2 seconds based on the polling interval. However, when switching tabs and returning after some time, there is a delay before the count updates by one. This delay affects real-time dashboard responsiveness, posing a UI performance concern.
I am curious about how web workers behave when their associated tab loses focus. Are they queuing tasks for execution upon regaining focus, or does the logging data fail to reach the console API when the parent window is inactive?
Would suspending the polling mechanism on tab unfocus contribute to resolving this issue?