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

Load sparkline images only once they are near view port #17937

Merged
merged 1 commit into from Aug 30, 2021

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Aug 30, 2021

Description:

fix #17774

Test locally and worked nicely. Had 11 goals and on my screen it loaded the first 9 goals right away and the other ones while scrolling. This way, if someone has say 25 goals, then we won't issue like 80 requests at the same time on goals overview or funnels overview page which can cause issues in the web server as well as database.

This won't impact reports like Visitors overview etc. where the sparklines are visible right away.

Works in modern browsers.

FYI @mattab

Review

fix #17774

Test locally and worked nicely. Had 11 goals and on my screen it loaded the first 9 goals right away and the other ones while scrolling. This way, if someone has say 25 goals, then we won't issue like 80 requests at the same time on goals overview or funnels overview page which can cause issues in the web server as well as database
@tsteur tsteur added the Needs Review PRs that need a code review label Aug 30, 2021
@tsteur tsteur added this to the 4.5.0 milestone Aug 30, 2021
Copy link
Contributor

@justinvelluppillai justinvelluppillai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks/works fine here.

Unrelated, but it feels like the piwik.initSparklines function below should just act on one element rather than all sparkline elements as it is called once for each sparkline anyway.

@justinvelluppillai justinvelluppillai merged commit b554740 into 4.x-dev Aug 30, 2021
@sgiehl sgiehl mentioned this pull request Sep 6, 2021
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Goal Overview Report & widget on dashboard can cause a very large spike in requests
2 participants