Closed ottok closed 4 years ago
By looking at syslogs at servers there is also lots of HTTP requests to /domains
. Should we use transients to reduce number of queries? Domains wont change all the time, retrieve data only once in 5 minutes or something?
Primary solution is not to do that many calls in the first place. I doubt the code is correct if 3 API calls are done in a row. Secondary solution is to cache it for a short time.
Let's wait until @JoosuaKoskinen has time to look into this.
I took a quick look and it's because domains are queried for each shadow individually (wp-palvelu.fi has 3 shadows). This should be possible with one call only. Will work on a fix tomorrow.
SWD API is quite fast but should the results be cached for a while to reduce the amount of requests?
While profiling the front page of seravo.com for slowness I noticed that the Seravo Plugin did 3 API calls to the domains end-point:
This was on the front page while logged into wp-admin.
I understand that the shadow data might be needed in this view to be able to render the shadow switcher, but why 3 calls to the domains API for this purpose? Seems like a bug. Please investigate.