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

XHR widget requests #11440

Closed
ctomczyk opened this issue Mar 2, 2017 · 1 comment
Closed

XHR widget requests #11440

ctomczyk opened this issue Mar 2, 2017 · 1 comment
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@ctomczyk
Copy link

ctomczyk commented Mar 2, 2017

Currently all widgets are sending XMLHttpRequests independently. I think this sometimes impacting on server performance, especially on shared hosting.

What I'd suggest is to use Promise (https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise) and queue all widget requests. I think there is no need to "attack" server with multiple requests at the same time. Just send one and wait until it finishes then send another one.

Possibly, this could be even configured in Piwik options to send widget XHR requests asynchronously or synchronously.

@mattab
Copy link
Member

mattab commented Mar 21, 2017

Thanks for the suggestion, but we won't queue XmlHttpRequests as it would be too slow from a user perspective.

@mattab mattab closed this as completed Mar 21, 2017
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Mar 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

2 participants