Gatsby builds slowed to 16-17 minutes from 3-4 minutes a few weeks ago

Most of my gatsby sites build in under 3 minutes but this particular headless ecommerce site has been building progressively slower over the last few weeks. And in the last few days build times have grown from ~7-8 minutes to ~16-17 minutes.

The netlify app url is ericaweiner.netlify.app.

Here’s a typical deploy log from a few weeks ago:

5:12:18 PM: Build ready to start
5:12:20 PM: build-image version: d84c79427e8f83c1ba17bcdd7b3fe38059376b68
5:12:20 PM: build-image tag: v3.6.1
5:12:20 PM: buildbot version: 29790781696345269c532deefac261952f54866d
5:12:20 PM: Fetching cached dependencies
5:12:20 PM: Starting to download cache of 218.7MB
5:12:21 PM: Finished downloading cache in 1.266430766s
5:12:21 PM: Starting to extract cache
5:12:30 PM: Finished extracting cache in 8.736784466s
5:12:30 PM: Finished fetching cache in 10.061831782s
5:12:30 PM: Starting to prepare the repo for build
5:12:31 PM: Preparing Git Reference refs/heads/master
5:12:32 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'web/public' versus 'public' in the Netlify UI
5:12:32 PM: Different functions path detected, going to use the one specified in the Netlify configuration file: 'web/functions' versus '' in the Netlify UI
5:12:32 PM: Different build command detected, going to use the one specified in the Netlify configuration file: 'gatsby build && netlify-lambda build src/lambda' versus 'npm run build' in the Netlify UI
5:12:33 PM: Starting build script
5:12:33 PM: Installing dependencies
5:12:33 PM: Python version set to 2.7
5:12:33 PM: Started restoring cached node version
5:12:36 PM: Finished restoring cached node version
5:12:37 PM: v12.18.0 is already installed.
5:12:37 PM: Now using node v12.18.0 (npm v6.14.4)
5:12:37 PM: Started restoring cached build plugins
5:12:37 PM: Finished restoring cached build plugins
5:12:37 PM: Attempting ruby version 2.7.1, read from environment
5:12:39 PM: Using ruby version 2.7.1
5:12:39 PM: Using PHP version 5.6
5:12:39 PM: Started restoring cached node modules
5:12:39 PM: Finished restoring cached node modules
5:12:39 PM: Started restoring cached go cache
5:12:39 PM: Finished restoring cached go cache
5:12:39 PM: go version go1.14.4 linux/amd64
5:12:39 PM: go version go1.14.4 linux/amd64
5:12:39 PM: Installing missing commands
5:12:39 PM: Verify run directory
5:12:41 PM: ​
5:12:41 PM: ────────────────────────────────────────────────────────────────
5:12:41 PM:   Netlify Build                                                 
5:12:41 PM: ────────────────────────────────────────────────────────────────
5:12:41 PM: ​
5:12:41 PM: ❯ Version
5:12:41 PM:   @netlify/build 9.1.2
5:12:41 PM: ​
5:12:41 PM: ❯ Flags
5:12:41 PM:   deployId: 6029ca72a5c1560008727aec
5:12:41 PM:   mode: buildbot
5:12:41 PM: ​
5:12:41 PM: ❯ Current directory
5:12:41 PM:   /opt/build/repo/web
5:12:41 PM: ​
5:12:41 PM: ❯ Config file
5:12:41 PM:   /opt/build/repo/web/netlify.toml
5:12:41 PM: ​
5:12:41 PM: ❯ Context
5:12:41 PM:   production
5:12:41 PM: ​
5:12:41 PM: ────────────────────────────────────────────────────────────────
5:12:41 PM:   1. build.command from netlify.toml                            
5:12:41 PM: ────────────────────────────────────────────────────────────────
5:12:41 PM: ​
5:12:41 PM: $ gatsby build && netlify-lambda build src/lambda
5:12:45 PM: success open and validate gatsby-configs - 0.555s
5:12:46 PM: success load plugins - 0.810s
5:12:46 PM: success onPreInit - 0.115s
5:12:46 PM: success delete html and css files from previous builds - 0.003s
5:12:46 PM: success initialize cache - 0.008s
5:12:46 PM: success copy gatsby files - 0.070s
5:12:46 PM: info [sanity] Fetching remote GraphQL schema
5:12:46 PM: info [sanity] Transforming to Gatsby-compatible GraphQL SDL
5:12:46 PM: info [sanity] Stitching GraphQL schemas from SDL
5:12:47 PM: success onPreBootstrap - 0.994s
5:12:47 PM: success createSchemaCustomization - 0.016s
5:12:47 PM: info [sanity] Fetching export stream for dataset
5:12:51 PM: info [sanity] Done! Exported 6120 documents.
5:12:51 PM: success Checking for changed pages - 0.000s
5:12:51 PM: success source and transform nodes - 4.000s
5:12:52 PM: success building schema - 0.728s
5:12:54 PM: info Total nodes: 6640, SitePage nodes: 459 (use --verbose for breakdown)
5:12:54 PM: success createPages - 2.050s
5:12:54 PM: success Checking for changed pages - 0.000s
5:12:54 PM: success createPagesStatefully - 0.098s
5:13:33 PM: success update schema - 39.474s
5:13:33 PM: success onPreExtractQueries - 0.003s
5:13:35 PM: success extract queries from components - 1.183s
5:13:35 PM: success write out redirect data - 0.001s
5:13:35 PM: success Build manifest and related icons - 0.257s
5:13:35 PM: success onPostBootstrap - 0.259s
5:13:35 PM: info bootstrap finished - 53.664s
5:13:35 PM: success run static queries - 0.019s - 3/3 160.53/s
5:13:36 PM: success run page queries - 0.680s - 466/466 685.48/s
5:13:36 PM: success write out requires - 0.031s
5:14:15 PM: 
5:14:15 PM: src/styles/radio-buttons.css
5:14:15 PM: 22:3	⚠  variable '--wine' is undefined and used without a fallback [postcss-custom-properties]
5:14:15 PM: 31:3	⚠  variable '--wine' is undefined and used without a fallback [postcss-custom-properties]
5:14:41 PM: success Building production JavaScript and CSS bundles - 65.213s
5:14:41 PM: success Rewriting compilation hashes - 0.002s
5:15:07 PM: success Building static HTML for pages - 23.599s - 466/466 19.75/s
5:15:08 PM: success onPostBuild - 0.565s
5:15:08 PM: info Done building in 146.786971938 sec
5:15:09 PM: netlify-lambda: Building functions
5:15:11 PM: Hash: a6acdab3c167f9c31a10
5:15:11 PM: Version: webpack 4.44.2
5:15:11 PM: Time: 1625ms
5:15:11 PM: Built at: 02/15/2021 1:15:11 AM
5:15:11 PM:                      Asset      Size  Chunks             Chunk Names
5:15:11 PM:           back-in-stock.js  38.5 KiB    0, 1  [emitted]  back-in-stock
5:15:11 PM:           requestConfig.js  5.55 KiB       1  [emitted]  requestConfig
5:15:11 PM: shopify-collection-sync.js   150 KiB    2, 1  [emitted]  shopify-collection-sync
5:15:11 PM:            shopify-sync.js   149 KiB    3, 1  [emitted]  shopify-sync
5:15:11 PM: Entrypoint back-in-stock = back-in-stock.js
5:15:11 PM: Entrypoint requestConfig = requestConfig.js
5:15:11 PM: Entrypoint shopify-collection-sync = shopify-collection-sync.js
5:15:11 PM: Entrypoint shopify-sync = shopify-sync.js
5:15:11 PM:   [0] /opt/build/repo/web/node_modules/object-assign/index.js 2.06 KiB {2} {3} [built]
5:15:11 PM:   [2] ./requestConfig.ts 3.48 KiB {0} {1} {2} {3} [built]
5:15:11 PM:   [3] external "stream" 42 bytes {0} {2} {3} [built]
5:15:11 PM:   [5] external "url" 42 bytes {0} {2} {3} [built]
5:15:11 PM:   [6] external "http" 42 bytes {0} {2} {3} [built]
5:15:11 PM:   [8] external "https" 42 bytes {0} {2} {3} [built]
5:15:11 PM:   [9] external "zlib" 42 bytes {0} {2} {3} [built]
5:15:11 PM:  [15] external "fs" 42 bytes {0} {1} {2} {3} [built]
5:15:11 PM:  [16] /opt/build/repo/web/node_modules/dotenv/lib/main.js 2.93 KiB {0} {1} {2} {3} [built]
5:15:11 PM:  [65] /opt/build/repo/web/node_modules/axios/index.js 40 bytes {0} {2} [built]
5:15:11 PM:  [66] /opt/build/repo/web/node_modules/@sanity/client/lib/sanityClient.js 3.43 KiB {2} {3} [built]
5:15:11 PM:  [67] external "crypto" 42 bytes {2} {3} [built]
5:15:11 PM: [169] ./back-in-stock.ts 899 bytes {0} [built]
5:15:11 PM: [170] ./shopify-collection-sync.ts 4.32 KiB {2} [built]
5:15:11 PM: [171] ./shopify-sync.ts + 2 modules 51.4 KiB {3} [built]
5:15:11 PM:       | ./shopify-sync.ts 10.6 KiB [built]
5:15:11 PM:       | /opt/build/repo/web/node_modules/shopify-gid/dist/shopify-gid.es.js 642 bytes [built]
5:15:11 PM:       | /opt/build/repo/web/node_modules/node-fetch/lib/index.mjs 40.1 KiB [built]
5:15:11 PM:     + 157 hidden modules
5:15:11 PM: ​
5:15:11 PM: (build.command completed in 2m 30.2s)
5:15:11 PM: ​
5:15:11 PM: ────────────────────────────────────────────────────────────────
5:15:11 PM:   2. Functions bundling                                         
5:15:11 PM: ────────────────────────────────────────────────────────────────
5:15:11 PM: ​
5:15:11 PM: Packaging Functions from functions directory:
5:15:11 PM:  - back-in-stock.js
5:15:11 PM:  - requestConfig.js
5:15:11 PM:  - shopify-collection-sync.js
5:15:11 PM:  - shopify-sync.js
5:15:14 PM: ​
5:15:14 PM: (Functions bundling completed in 2.2s)
5:15:14 PM: ​
5:15:14 PM: ────────────────────────────────────────────────────────────────
5:15:14 PM:   3. Deploy site                                                
5:15:14 PM: ────────────────────────────────────────────────────────────────
5:15:14 PM: ​
5:15:14 PM: Starting to deploy site from 'web/public'
5:15:14 PM: Creating deploy tree asynchronously
5:15:14 PM: Creating deploy upload records
5:15:16 PM: 473 new files to upload
5:15:16 PM: 0 new functions to upload
5:15:30 PM: Site deploy was successfully initiated
5:15:30 PM: ​
5:15:30 PM: (Deploy site completed in 16.7s)
5:15:30 PM: ​
5:15:30 PM: ────────────────────────────────────────────────────────────────
5:15:30 PM:   Netlify Build Complete                                        
5:15:30 PM: ────────────────────────────────────────────────────────────────
5:15:30 PM: ​
5:15:30 PM: (Netlify Build completed in 2m 49.2s)
5:15:30 PM: Caching artifacts
5:15:30 PM: Started saving node modules
5:15:30 PM: Finished saving node modules
5:15:30 PM: Started saving build plugins
5:15:30 PM: Finished saving build plugins
5:15:30 PM: Started saving pip cache
5:15:31 PM: Finished saving pip cache
5:15:31 PM: Started saving emacs cask dependencies
5:15:31 PM: Finished saving emacs cask dependencies
5:15:31 PM: Started saving maven dependencies
5:15:31 PM: Finished saving maven dependencies
5:15:31 PM: Started saving boot dependencies
5:15:31 PM: Finished saving boot dependencies
5:15:31 PM: Started saving rust rustup cache
5:15:31 PM: Finished saving rust rustup cache
5:15:31 PM: Started saving go dependencies
5:15:31 PM: Finished saving go dependencies
5:15:31 PM: Build script success
5:15:34 PM: Starting post processing
5:15:34 PM: Post processing - HTML
5:16:14 PM: Post processing - header rules
5:16:14 PM: Post processing - redirect rules
5:16:14 PM: Post processing done
5:16:15 PM: Site is live ✨
5:16:15 PM: Finished processing build request in 3m55.507167443s

Compared to one from today:

6:26:20 PM: Build ready to start
6:26:22 PM: build-image version: 3571f0130496395a23bffe9820bc78b4f73a6234
6:26:22 PM: build-image tag: v3.7.0
6:26:22 PM: buildbot version: 89fd0aa6bcd88a2db5e5fe57a2179df0d7a1e96e
6:26:22 PM: Fetching cached dependencies
6:26:23 PM: Starting to download cache of 417.8MB
6:26:28 PM: Finished downloading cache in 5.100170627s
6:26:28 PM: Starting to extract cache
6:26:48 PM: Finished extracting cache in 20.611827906s
6:26:48 PM: Finished fetching cache in 26.009865894s
6:26:48 PM: Starting to prepare the repo for build
6:26:49 PM: Preparing Git Reference refs/heads/master
6:26:52 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'web/public' versus 'public' in the Netlify UI
6:26:52 PM: Different functions path detected, going to use the one specified in the Netlify configuration file: 'web/functions' versus '' in the Netlify UI
6:26:52 PM: Different build command detected, going to use the one specified in the Netlify configuration file: 'gatsby build && netlify-lambda build src/lambda' versus 'npm run build' in the Netlify UI
6:26:52 PM: Starting build script
6:26:52 PM: Installing dependencies
6:26:52 PM: Python version set to 2.7
6:26:53 PM: Started restoring cached node version
6:26:56 PM: Finished restoring cached node version
6:26:57 PM: v12.18.0 is already installed.
6:26:58 PM: Now using node v12.18.0 (npm v6.14.4)
6:26:58 PM: Started restoring cached build plugins
6:26:58 PM: Finished restoring cached build plugins
6:26:59 PM: Attempting ruby version 2.7.1, read from environment
6:27:01 PM: Using ruby version 2.7.1
6:27:01 PM: Using PHP version 5.6
6:27:01 PM: Started restoring cached node modules
6:27:01 PM: Finished restoring cached node modules
6:27:02 PM: Started restoring cached go cache
6:27:02 PM: Finished restoring cached go cache
6:27:02 PM: go version go1.14.4 linux/amd64
6:27:02 PM: go version go1.14.4 linux/amd64
6:27:02 PM: Installing missing commands
6:27:02 PM: Verify run directory
6:27:04 PM: ​
6:27:04 PM: ────────────────────────────────────────────────────────────────
6:27:04 PM:   Netlify Build                                                 
6:27:04 PM: ────────────────────────────────────────────────────────────────
6:27:04 PM: ​
6:27:04 PM: ❯ Version
6:27:04 PM:   @netlify/build 9.9.3
6:27:04 PM: ​
6:27:04 PM: ❯ Flags
6:27:04 PM:   apiHost: api.netlify.com
6:27:04 PM:   cacheDir: /opt/build/cache
6:27:04 PM:   deployId: 604ad14c99d56f000896991d
6:27:04 PM:   mode: buildbot
6:27:04 PM:   testOpts:
6:27:04 PM:     silentLingeringProcesses: ''
6:27:04 PM: ​
6:27:04 PM: ❯ Current directory
6:27:04 PM:   /opt/build/repo/web
6:27:04 PM: ​
6:27:04 PM: ❯ Config file
6:27:04 PM:   /opt/build/repo/web/netlify.toml
6:27:04 PM: ​
6:27:04 PM: ❯ Context
6:27:04 PM:   production
6:27:04 PM: ​
6:27:04 PM: ────────────────────────────────────────────────────────────────
6:27:04 PM:   1. build.command from netlify.toml                            
6:27:04 PM: ────────────────────────────────────────────────────────────────
6:27:04 PM: ​
6:27:04 PM: $ gatsby build && netlify-lambda build src/lambda
6:27:10 PM: success open and validate gatsby-configs - 0.721s
6:27:11 PM: success load plugins - 1.049s
6:27:11 PM: success onPreInit - 0.178s
6:27:11 PM: success delete html and css files from previous builds - 0.004s
6:27:11 PM: success initialize cache - 0.012s
6:27:11 PM: success copy gatsby files - 0.081s
6:27:11 PM: info [sanity] Fetching remote GraphQL schema
6:27:12 PM: info [sanity] Transforming to Gatsby-compatible GraphQL SDL
6:27:12 PM: info [sanity] Stitching GraphQL schemas from SDL
6:27:12 PM: success onPreBootstrap - 1.191s
6:27:12 PM: success createSchemaCustomization - 0.055s
6:27:13 PM: info [sanity] Fetching export stream for dataset
6:27:19 PM: info [sanity] Done! Exported 7290 documents.
6:27:19 PM: success Checking for changed pages - 0.001s
6:27:19 PM: success source and transform nodes - 6.602s
6:27:20 PM: success building schema - 1.110s
6:28:06 PM: info Total nodes: 7952, SitePage nodes: 601 (use --verbose for breakdown)
6:28:06 PM: success createPages - 45.701s
6:28:06 PM: success Checking for changed pages - 0.000s
6:28:06 PM: success createPagesStatefully - 0.163s
6:40:39 PM: success update schema - 753.175s
6:40:39 PM: success onPreExtractQueries - 0.012s
6:40:42 PM: success extract queries from components - 2.500s
6:40:42 PM: success write out redirect data - 0.004s
6:40:43 PM: success Build manifest and related icons - 0.805s
6:40:43 PM: success onPostBootstrap - 0.809s
6:40:43 PM: info bootstrap finished - 818.081s
6:40:43 PM: success run static queries - 0.916s - 4/4 4.37/s
6:40:54 PM: success run page queries - 10.822s - 612/612 56.55/s
6:40:54 PM: success write out requires - 0.046s
6:42:30 PM: warning "export 'AboutBodyInterface' was not found in './about-body'
warning "export 'AboutHouseInterface' was not found in './about-house'
warning "export 'AboutIntroInterface' was not found in './about-intro'
warning "export 'ContactInterface' was not found in './contact'
warning "export 'ShopifyProductData' was not found in './form'
success Building production JavaScript and CSS bundles - 95.994s
6:42:31 PM: success Rewriting compilation hashes - 0.003s
6:44:45 PM: success Building static HTML for pages - 92.982s - 612/612 6.58/s
6:44:57 PM: success onPostBuild - 11.570s
6:45:04 PM: info Done building in 1079.775655639 sec
6:45:05 PM: netlify-lambda: Building functions
6:45:08 PM: Hash: a6acdab3c167f9c31a10
6:45:08 PM: Version: webpack 4.44.2
6:45:08 PM: Time: 1958ms
6:45:08 PM: Built at: 03/12/2021 2:45:08 AM
6:45:08 PM:                      Asset      Size  Chunks             Chunk Names
6:45:08 PM:           back-in-stock.js  38.5 KiB    0, 1  [emitted]  back-in-stock
6:45:08 PM:           requestConfig.js  5.55 KiB       1  [emitted]  requestConfig
6:45:08 PM: shopify-collection-sync.js   150 KiB    2, 1  [emitted]  shopify-collection-sync
6:45:08 PM:            shopify-sync.js   149 KiB    3, 1  [emitted]  shopify-sync
6:45:08 PM: Entrypoint back-in-stock = back-in-stock.js
6:45:08 PM: Entrypoint requestConfig = requestConfig.js
6:45:08 PM: Entrypoint shopify-collection-sync = shopify-collection-sync.js
6:45:08 PM: Entrypoint shopify-sync = shopify-sync.js
6:45:08 PM:   [0] /opt/build/repo/web/node_modules/object-assign/index.js 2.06 KiB {2} {3} [built]
6:45:08 PM:   [2] ./requestConfig.ts 3.48 KiB {0} {1} {2} {3} [built]
6:45:08 PM:   [3] external "stream" 42 bytes {0} {2} {3} [built]
6:45:08 PM:   [5] external "url" 42 bytes {0} {2} {3} [built]
6:45:08 PM:   [6] external "http" 42 bytes {0} {2} {3} [built]
6:45:08 PM:   [8] external "https" 42 bytes {0} {2} {3} [built]
6:45:08 PM:   [9] external "zlib" 42 bytes {0} {2} {3} [built]
6:45:08 PM:  [15] external "fs" 42 bytes {0} {1} {2} {3} [built]
6:45:08 PM:  [16] /opt/build/repo/web/node_modules/dotenv/lib/main.js 2.93 KiB {0} {1} {2} {3} [built]
6:45:08 PM:  [65] /opt/build/repo/web/node_modules/axios/index.js 40 bytes {0} {2} [built]
6:45:08 PM:  [66] /opt/build/repo/web/node_modules/@sanity/client/lib/sanityClient.js 3.43 KiB {2} {3} [built]
6:45:08 PM:  [67] external "crypto" 42 bytes {2} {3} [built]
6:45:08 PM: [169] ./back-in-stock.ts 899 bytes {0} [built]
6:45:08 PM: [170] ./shopify-collection-sync.ts 4.32 KiB {2} [built]
6:45:08 PM: [171] ./shopify-sync.ts + 2 modules 51.4 KiB {3} [built]
6:45:08 PM:       | ./shopify-sync.ts 10.6 KiB [built]
6:45:08 PM:       | /opt/build/repo/web/node_modules/shopify-gid/dist/shopify-gid.es.js 642 bytes [built]
6:45:08 PM:       | /opt/build/repo/web/node_modules/node-fetch/lib/index.mjs 40.1 KiB [built]
6:45:08 PM:     + 157 hidden modules
6:45:09 PM: ​
6:45:09 PM: (build.command completed in 18m 4.3s)
6:45:09 PM: ​
6:45:09 PM: ────────────────────────────────────────────────────────────────
6:45:09 PM:   2. Functions bundling                                         
6:45:09 PM: ────────────────────────────────────────────────────────────────
6:45:09 PM: ​
6:45:09 PM: Packaging Functions from functions directory:
6:45:09 PM:  - back-in-stock.js
6:45:09 PM:  - requestConfig.js
6:45:09 PM:  - shopify-collection-sync.js
6:45:09 PM:  - shopify-sync.js
6:45:11 PM: ​
6:45:11 PM: (Functions bundling completed in 2.6s)
6:45:11 PM: ​
6:45:11 PM: ────────────────────────────────────────────────────────────────
6:45:11 PM:   3. Deploy site                                                
6:45:11 PM: ────────────────────────────────────────────────────────────────
6:45:11 PM: ​
6:45:11 PM: Starting to deploy site from 'web/public'
6:45:13 PM: Creating deploy tree asynchronously
6:45:13 PM: Creating deploy upload records
6:45:15 PM: 1228 new files to upload
6:45:15 PM: 0 new functions to upload
6:45:58 PM: Site deploy was successfully initiated
6:45:58 PM: ​
6:45:58 PM: (Deploy site completed in 46.6s)
6:45:58 PM: ​
6:45:58 PM: ────────────────────────────────────────────────────────────────
6:45:58 PM:   Netlify Build Complete                                        
6:45:58 PM: ────────────────────────────────────────────────────────────────
6:45:58 PM: ​
6:45:58 PM: (Netlify Build completed in 18m 53.6s)
6:45:58 PM: Execution timed out after 19m6.106667277s
6:45:58 PM: Error running command: Command did not finish within the time limit
6:45:58 PM: Failing build: Failed to build site
6:45:58 PM: Failed during stage 'building site': Command did not finish within the time limit
6:45:58 PM: Finished processing build request in 19m35.757627241s
6:46:05 PM: Starting post processing
6:46:05 PM: Post processing - HTML
6:47:02 PM: Post processing - header rules
6:47:02 PM: Post processing - redirect rules
6:47:02 PM: Post processing done
6:47:02 PM: Site is live ✨

The step that seems to be taking a lot more time is:

12:37:56 PM: success update schema - 705.260s

Hi, @blimpmason. I think most of what you are seeing is directly related to the growth in the size of the site.

For example:

The increase does appear to be related to the site and number of pages in the site because this is likely impacting the size and/or complexity of the schema. In other words, a bigger site is taking longer to build but it isn’t due to any changes at Netlify - it is just because it is bigger.

The troubleshooting of custom code (like deployed site javascript or the build process your site uses) isn’t covered in the scope of the support team’s technical support. So, someone else might be able to help you profile your Gatsby site build to find out why the schema generation steps takes this long but our support team will not have the resources to do so.

Other members of this forum may have thoughts, though, and you are welcome to ask questions like this here. I just wanted to set expectations about whether or not our support team would have additional information about this.

Thanks @luke, that makes sense.

I also came across this Gatsby issue which also applies in my case:

In my gatsby-node I’m fetching all the page data and passing it as page context for each node, rather than just fetching an id and letting the page template fetch the rest. I’m going to try refactoring to only fetch/pass the node id as page context and see if that helps.

1 Like

great, thanks for sharing that. it definitely seems relevant! let us know how it goes.

Quick follow up for future readers:

After implementing updates to my gatsby-node.js to only fetch the node id and then setting up gatsby page queries on each page template to fetch the page content, my β€œupdate schema” is now happening in under 1 second, down from ~700 seconds. Total build time is back down to a reasonable ~3-4 minutes even with hundreds of pages.

So that’s definitely the right way to fetch page content data!

1 Like