Gatsby Cloud preview is very slow (3 min plus) using gatsby-source-contentful
plugin
#31280
Replies: 3 comments 9 replies
-
Also, I've been looking at the config for the |
Beta Was this translation helpful? Give feedback.
-
Huh wow. For fun, how many nodes are being created? Tagging @axe312ger. He would know if contentful's API allows for filtering your content to just the content for a single site. If so, seem pretty reasonable to support that in the source plugin. |
Beta Was this translation helpful? Give feedback.
-
So this line here could be modified in order to sync a specific content instead of all content: by using the I'm going to try some performance measurements using the data in my space with and without setting the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
We just started using Gatsby Cloud on a trial run with our organization. We host 600+ static sites with all of the content being modeled and persisted within Contentful. We recently began re-tooling our querying for site data to try and take advantage of Cloud Previews.
The way we use Contentful is that we have a top-level content model called
Website
where each site has a unique key calledsiteId
. All of the site data is joined into theWebsite
content instance via content relations. For a given instance of the app, we only need the data for one site via it'ssiteId
. IE, each Gatsby app instance serves previews for one site.When our Gatsby app builds, the
gatsby-contentful-source
plugin gets the data for the entire space on Contentful, ie 600+ sites and all of their content. This takes a long time for sourcing, fetching, syncing and building. For builds, this isn't so much an issue as we do not need published edits to show near-real-time changes in the published site.However, we do want near-real-time updates to the preview sites and it seems that the Preview builds spend a lot of time processing data, which is the bottleneck step for time efficiency. You can see that the Preview re-build to ~1 min on Gatsby Cloud for a change in one text field:
Steps to reproduce
This is more a question content architecture in relation to Gatsby Cloud architecture. We can't really advise on how to repro this unless you have access to our deeply nested content model.
Expected result
Near-instant preview build updates.
Actual result
Preview build updates took over a minute.
Environment
Beta Was this translation helpful? Give feedback.
All reactions