git-updater: Slow AJAX performance for admin users
We are noticing GitHub Updater causing serious performance impacts on the front-end, on the order of 1-10 seconds per request, including AJAX requests. We have traced it to get_remote_repo_meta()
being called on every request, in the following code path:
This seems very wrong; get_remote_repo_meta()
seems like it should only be called in wp_cron
scheduled events, correct?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 28 (28 by maintainers)
đđź Iâm glad we were able to find a solution to this. Thanks for reporting it and for all the work and testing youâve done.
BTW, itâs the second shiny update without a page load in between that requires the run on admin-ajax.php đ
On
develop
, I confirmed that theadmin-ajax.php
requests finish in ~0.8 seconds now instead of ~12 seconds in the environment above (25 GHU-aware plugins/themes present on vanilla WordPress in a local vagrant).Also confirmed in the Pressbooks environment, frontend and backend AJAX calls dropped from ~7 seconds each to ~800ms each (700ms with GHU deactivated). Sounds like a success to me!
I also tested a shiny update (clicking âupdate nowâ on the Plugins page for a GHU-aware plugin with pending updates), and it worked fine.
Re: REST, if it were me I wouldnât bother trying to create a real REST endpointâŚthe admin-ajax.php one you built works just fine, and I donât think you can get away from the AJAX dependency because of the shiny update system in WordPress core.
Thanks for your time on this one!
Will check out the
develop
branch and let you know. Thanks!