I've created an empty HTML page with a simple setInterval()
that fires an AJAX call, via window.fetch()
, every 30 seconds, indefinitely. In Chrome, however, if I leave my computer for 24 hours and come back to it, I notice that at some point, the AJAX calls stopped firing.
Note that this computer does not go to sleep, hibernate, screen lock, etc. In other words, I walk away from the monitor, come back the next day, see the exact same screen I left it at when the day prior, and yet the Network tab in the Chrome debugger shows the browser stopped making the AJAX calls at some point.
What I'm wondering is, do browsers have some sort of internal process or thread management where they put "idle" tabs to sleep and stop executing network calls, or stop executing JavaScript intervals and/or timeouts? Is there some sort of resource conservation/memory management modern browsers do, where they put tabs to "sleep", that might explain this?