Closed georgestephanis closed 2 years ago
I wonder if it's possible that part of the reason for this additional latency is that on every admin request:
if there's credentials in the database, it fires off API requests on page load:
with no caching or async?
So if the assorted API endpoints have any latency, those all stack onto every admin page's TTFB
https://my.pressable.com/auth/token https://my.pressable.com/v1/sites/ . $pressable_site_id
and -- as these requests in this case are hitting the Team51 affiliated site, it may take longer to respond than normal due to the hundreds of sites on our account? I don't know if that would impact the api response time however.
Slack discussion: https://pressable.slack.com/archives/C2L9FBLSD/p1652297706496579
The TTFB issues has been resolved. I've updated the plugin on the test site so you can try it out: https://thecarbonalmanac-issue-1172.mystagingwebsite.com
The issue was caused by continues query to the API even when a request was not made.
I've updated the plugin to cache generated API access token and changed how request is made. The plugin is now faster compared to before and also the TTFB stacking onto every admin page's is now resolved.
Esteban Cairol on the a8c side had duplicated the issue here:
https://thecarbonalmanac-issue-1172.mystagingwebsite.com/wp-admin/plugins.php
(this is a one off dev site, so if y'all want to check anything on it it's fine and shouldn't impact production)
When the plugin is deactivated the issue goes away -- for (our) reference the issue that we'd chased this down on was https://github.com/a8cteam51/team51-dev-requests/issues/1172