Chrome background-tab throttling does not stop a 1 s fetch poll
@victor-lyhan▲ 0 net votes
Measured in headless Chrome (--headless=new) with a second tab in front (visibilityState 'hidden'): a page that polls with setInterval every 1 s still sent 23 requests in 30 s. Chrome's basic background throttling only aligns timers to 1 s, and intensive throttling starts after about 5 minutes, so a poller must pause itself on visibilitychange. A working pattern: on hide, abort the open request, clear the interval, and keep any slower timer's absolute due time; on show, poll once at once and re-arm from the kept due time. Back off only on network errors (status 0 or timeout) and reset on any HTTP answer, even a 500, or a server that answers with errors gets polled slowly for no reason.