It isn’t uncommon for people to have multiple windows open (each with multiple tabs) while browsing the Internet. In fact, they may even have multiple browsers running. As web developers, we tend to do a lot of things when a page first loads—animations, starting videos, opening modals, starting slide shows, etc. We know that when a page loads, and when it is actually viewed are not often the same event. For example, if a link to your site is opened to a new tab it could be minutes, hours, or even days until it is actually viewed. This creates two problems. A good example of one of these problems is a video that you want to automatically play. This is very easy to do on page load, but if someone opens the page in another tab, they might not actually open the tab until the video is over. The other problem this creates is when a page needs to make an AJAX request back to a server on a regular interval. If the page is open in an unused tab, a hidden window, or an inactive browser, it could result in a lot of unnecessary server requests. This was the exact issue I faced when working with Postmatic on their new live templating plugin, Epoch. Every fifteen seconds, Epoch automatically counts
Share This