Paginated and concurrent requests
-
Is there a way to get large amount of data from WPGraphQL concurrently?
I’m making website with Gatsby.js, where WordPress is the main source of data. There is almost 60k of posts and even more media items. Server is very efficient (16CPU, 32GB of RAM), but anyway getting data from WordPress is huge… bottleneck.
I’ve changed max number of returned objects to 1000. Server can handle 60 concurrent requests in 16 seconds, each one returning for example 1000 media items. But due to fact, that the only available in wpgraphql metod of pagination is cursor-based pagination I can’t send concurent request. It’s because in the next request I have to provide endCursor from previous request as an after parameter. This leads to 200 sec wasted for getting 60k objects, that concurently could be returned in 16 sec. Am I missing something? Is there any solution?
As a result full build of my website takes 80 minutes and 90% of that time is taken by getting data from WordPress.
- The topic ‘Paginated and concurrent requests’ is closed to new replies.