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

Cache dashboard, avoid running queries. (fix #3) #6

merged 5 commits into from Jun 9, 2017


Copy link

commented Jun 8, 2017

There is a new bin/cache.php file that can be setup as a cron job, it should be run like this:

wp eval-file bin/cache.php

This will store the rendered html into a transient, and will avoid running the SQL unnecessarily.

Other ways that we could optimize:

  • The pressbooks_stats_exports could have millions of rows on pressbooks dot com, but the stats page doesn't look further than 4 months. We could delete every now and then?
  • Maybe add MySQL indexes on wp_users:user_registered and wp_blogs:registered? I'd want to wait for New Relic to see if this is identified as a slow query first though.

This comment has been minimized.

Copy link

commented Jun 8, 2017

Codecov Report

Merging #6 into dev will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@        Coverage Diff        @@
##           dev    #6   +/-   ##
  Coverage    0%    0%           
  Files        2     2           
  Lines      297   278   -19     
+ Misses     297   278   -19
Impacted Files Coverage Δ
inc/stats/namespace.php 0% <0%> (ø)
inc/helpers/namespace.php 0% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cdf4c0f...8b78638. Read the comment docs.

@connerbw connerbw changed the title Optimize db Cache dashboard, avoid running queries. (fix #3) Jun 8, 2017

Copy link

left a comment

Looks great!

@greatislander greatislander merged commit b9a0847 into dev Jun 9, 2017

3 checks passed

codecov/patch 0% of diff hit (target 0%)
codecov/project 0% (+0%) compared to cdf4c0f
continuous-integration/travis-ci/pr The Travis CI build passed

@greatislander greatislander deleted the optimize-db branch Jun 9, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.