Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow down updates when tab is in background #36

Open
aalin opened this issue Nov 1, 2022 · 0 comments
Open

Slow down updates when tab is in background #36

aalin opened this issue Nov 1, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@aalin
Copy link
Contributor

aalin commented Nov 1, 2022

Listen to the visibilitychange-event and notify the server when it happens.

Pseudo-code:

document.addEventListener("visibilitychange", () => {
  postCallback(sessionId, "visibilitychange", document.visibilityState);
});

And then on the server, the session could reduce the rate of updates, maybe do them once per second, or maybe even wait a longer time if the tab has been left in the background for a while.

This would reduce server load and network traffic when tabs are left in the background.

@aalin aalin added the enhancement New feature or request label Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant