contentstack / gatsby-source-contentstack

Contentstack provides a source plugin for pulling content into Gatsby from Contentstack stacks. It helps you query content types and entries in Gatsby using GraphQL
MIT License
14 stars 31 forks source link

Fetching content drastically slowed down in 5.1.0 update #204

Open kramerkm opened 1 year ago

kramerkm commented 1 year ago

After updating to 5.1.0, our local development boot-up time has slowed quite a bit. The "Fetching Contentstack data - Starting to fetch data from Contentstack" step takes ~15 minutes to finish with 5.1.0 on our site that is around ~1k pages.

When I lock in the version at 5.0.4, it takes ~30 seconds for that step to finish.

abhishek305 commented 1 year ago

@kramerkm Thanks for pointing this out. We'll look into this & add our observations.

Note: Please refer to the release changes for v5.1.0 --> release before upgrading to v5.1.0

@Contentstack-AnkitaD Please check this.

kramerkm commented 1 year ago

@abhishek305 Any update on this?

Contentstack-AnkitaD commented 1 year ago

@abhishek305 Any update on this?

Hi @kramerkm

Sorry for the late update missed this notification,

To dig into this issue.. I checked on a similar site with around 8k entries.. On my end.. v5.0.4 took around ~17s whereas the same on v5.1.0 took ~2s.

Can you please share more details in order to reproduce this?

Thanks

kramerkm commented 1 year ago

These are the current options we're using in the plugin:

{
    resolve: `gatsby-source-contentstack`,
    options: {
        api_key: api_key,
        delivery_token: token,
        environment: env,
        excludeContentTypes: array of ~13 content-types,
        expediteBuild: true,
        enableSchemaGeneration: true,
    },
},

I played around with removing some options and it looks like it struggles on the excludeContentTypes. When that is removed, it runs just as fast as v5.0.4.