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 loading of total views per post #271

Open
yellowmastodon opened this issue Nov 17, 2024 · 0 comments
Open

slow loading of total views per post #271

yellowmastodon opened this issue Nov 17, 2024 · 0 comments

Comments

@yellowmastodon
Copy link

Background: Planned to use koko_analytics in a news site project, which displays post views on the front end both in single-post and archive view. I have already imported stats from jetpack, since this is a redesign of an ongoing project.

Issue:

  1. Loading of the views via shortcode does not allow total views, only for specified amount of days.
  2. Loading the views for 10 years slows down archive page (with 24 posts) load from 600ms to 2500ms in local environment

The issue lies probably in large query, that is performed due to the fact, that the stats are saved to database per post per day.

Proposed solution:
There could be a separate database table, which stores only total amount of views/visitors per post. Probably could even have two more tables, which store them per year and per month for easier query.

dannyvankooten added a commit that referenced this issue Nov 18, 2024
…previous period, but explicitly calling the method again where needed. Relates to #271
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant