Reputation: 454
I have a nuxt app that get it's data from a Wordpress rest api, when you run nuxt generate i have about a 100 pages generated simultaneously. Now like 80% of these api calls made while generating fail with a status 500.
However if i visit this URL in development mode it works perfectly, and sometimes it actually gets generated (it's kind of random). So i'm thinking it's because of the massive amount of request.
Now i've tested this also in the front-end and did 500 requests simultaneously and this doesn't fail. So first i taught it is a memory issue in the backend but i'm not sure why i don't have the same problem in the front-end.
Any ideas?
Upvotes: 0
Views: 540
Reputation: 46
I am a bit late but this might help future people from Google as this thread came up pretty high.
WordPress does not seem to like receiving multiple requests, especially if your site contains multiple pages. Adding the interval property in your nuxt.config.js
(as pointed out by Hermann Dettmann) will space out the generation of each page.
It usually fix this issue for me. The task will take more time to execute, but at least it won't blow up.
export default {
mode: 'universal',
generate: {
interval: 1000,
/* ... */
}
/* ... */
}
Upvotes: 0
Reputation: 240
I had the same issue and could track this down to two problems:
Maybe this helps.
Upvotes: 1