Using netlify plugins with netlify-plugin-gatsby-cache
increases build time rather than reducing. I followed your blog post and noticed my builds are now longer. Iβm not using any CMS just building from a github repo.
As you can see, my builds are now taking over a minute longer and removing the plugin brings build time back down to normal level.
first enabled build log
11:54:33 AM: Build ready to start
11:54:35 AM: build-image version: 6dfe19d15f524c85d6f9bf7df9fb30b0a9f0a61a
11:54:35 AM: build-image tag: v3.3.10
11:54:35 AM: buildbot version: 6bb3f784302b4ad90de13035b247a363a8bee34a
11:54:35 AM: Fetching cached dependencies
11:54:36 AM: Starting to download cache of 196.9MB
11:54:37 AM: Finished downloading cache in 1.153179315s
11:54:37 AM: Starting to extract cache
11:54:47 AM: Finished extracting cache in 10.139016408s
11:54:47 AM: Finished fetching cache in 11.341071829s
11:54:47 AM: Starting to prepare the repo for build
11:54:47 AM: Preparing Git Reference refs/heads/master
11:54:49 AM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'public' versus 'public/' in the Netlify UI
11:54:49 AM: Starting build script
11:54:49 AM: Installing dependencies
11:54:50 AM: Started restoring cached node version
11:54:57 AM: Finished restoring cached node version
11:55:00 AM: v10.20.1 is already installed.
11:55:01 AM: Now using node v10.20.1 (npm v6.14.4)
11:55:01 AM: Attempting ruby version 2.6.2, read from environment
11:55:02 AM: Using ruby version 2.6.2
11:55:02 AM: Using PHP version 5.6
11:55:02 AM: 5.2 is already installed.
11:55:02 AM: Using Swift version 5.2
11:55:02 AM: Started restoring cached node modules
11:55:02 AM: Finished restoring cached node modules
11:55:02 AM: Started restoring cached yarn cache
11:55:02 AM: Finished restoring cached yarn cache
11:55:03 AM: Installing NPM modules using Yarn version 1.17.0
11:55:04 AM: yarn install v1.17.0
11:55:04 AM: [1/4] Resolving packages...
11:55:05 AM: success Already up-to-date.
11:55:05 AM: Done in 1.16s.
11:55:05 AM: NPM modules installed using Yarn
11:55:06 AM: Started restoring cached go cache
11:55:06 AM: Finished restoring cached go cache
11:55:06 AM: go version go1.12 linux/amd64
11:55:06 AM: go version go1.12 linux/amd64
11:55:06 AM: Installing missing commands
11:55:06 AM: Verify run directory
11:55:08 AM: β
11:55:08 AM: βββββββββββββββββββββββββββββββ
11:55:08 AM: β Netlify Build β
11:55:08 AM: βββββββββββββββββββββββββββββββ
11:55:08 AM: β
11:55:08 AM: β― Version
11:55:08 AM: @netlify/build 0.4.24
11:55:08 AM: β
11:55:08 AM: β― Flags
11:55:08 AM: mode: buildbot
11:55:08 AM: β
11:55:08 AM: β― Current directory
11:55:08 AM: /opt/build/repo
11:55:08 AM: β
11:55:08 AM: β― Config file
11:55:08 AM: /opt/build/repo/netlify.toml
11:55:08 AM: β
11:55:08 AM: β― Context
11:55:08 AM: production
11:55:08 AM: β
11:55:08 AM: β― Installing plugins
11:55:08 AM: - netlify-plugin-gatsby-cache
11:57:06 AM: β
11:57:06 AM: β― Loading plugins
11:57:06 AM: - netlify-plugin-gatsby-cache@0.2.1
11:57:06 AM: β
11:57:06 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
11:57:06 AM: β 1. onPreBuild command from netlify-plugin-gatsby-cache β
11:57:06 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
11:57:06 AM: β
11:57:06 AM: No Gatsby cache found. Building fresh.
11:57:06 AM: β
11:57:06 AM: (netlify-plugin-gatsby-cache onPreBuild completed in 7ms)
11:57:06 AM: β
11:57:06 AM: ββββββββββββββββββββββββββββββββββββββ
11:57:06 AM: β 2. build.command from netlify.toml β
11:57:06 AM: ββββββββββββββββββββββββββββββββββββββ
11:57:06 AM: β
11:57:06 AM: $ gatsby build
11:57:12 AM:
11:57:12 AM:
11:57:12 AM: success open and validate gatsby-configs - 0.143s
11:57:13 AM:
11:57:13 AM: success load plugins - 0.960s
11:57:13 AM: success onPreInit - 0.002s
11:57:13 AM: success delete html and css files from previous builds - 0.010s
11:57:13 AM:
11:57:13 AM: success initialize cache - 0.007s
11:57:13 AM: success copy gatsby files - 0.034s
11:57:13 AM: success onPreBootstrap - 0.012s
11:57:13 AM:
11:57:13 AM: success createSchemaCustomization - 0.020s
11:57:13 AM:
11:57:13 AM: success source and transform nodes - 0.516s
11:57:13 AM:
11:57:13 AM: warning Plugin `gatsby-source-filesystem` tried to define built-in Gatsby GraphQL type `File`
11:57:13 AM:
11:57:13 AM:
11:57:13 AM: warning Plugin `gatsby-source-filesystem` tried to define built-in Gatsby GraphQL type `File`
11:57:13 AM:
11:57:13 AM: warning Plugin `gatsby-source-filesystem` tried to define built-in Gatsby GraphQL type `File`
11:57:14 AM:
11:57:14 AM: success building schema - 0.623s
11:57:14 AM:
11:57:14 AM: success createPages - 0.140s
11:57:14 AM: success createPagesStatefully - 0.106s
11:57:14 AM: success onPreExtractQueries - 0.000s
11:57:14 AM:
11:57:14 AM: success update schema - 0.041s
11:57:15 AM:
11:57:15 AM: success extract queries from components - 0.528s
11:57:15 AM: success write out requires - 0.004s
11:57:15 AM:
11:57:15 AM: success write out redirect data - 0.001s
11:57:15 AM: success Build manifest and related icons - 0.197s
11:57:15 AM:
11:57:15 AM: success onPostBootstrap - 0.198s
11:57:15 AM:
11:57:15 AM:
11:57:15 AM: β
11:57:15 AM:
11:57:15 AM: info bootstrap finished - 8.662s
11:57:15 AM:
11:57:15 AM: β
11:57:23 AM:
11:57:23 AM: Skipping purge because no template paths provided...
11:57:23 AM: Skipping purge because no template paths provided...
11:57:25 AM:
11:57:25 AM: warning Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
11:57:25 AM:
11:57:25 AM: warning Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
11:57:25 AM:
11:57:25 AM: warning Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
11:57:25 AM:
11:57:25 AM:
11:57:25 AM: warning Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
11:57:25 AM:
11:57:25 AM: warning Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
11:57:25 AM:
11:57:25 AM: warning Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
11:57:27 AM: Skipping purge because no template paths provided...
11:57:39 AM:
11:57:39 AM: gatsby-plugin-purgecss: Only processing /opt/build/repo/src/styles/style.css
11:57:52 AM:
11:57:52 AM:
11:57:52 AM: success Building production JavaScript and CSS bundles - 37.331s
11:57:52 AM:
11:57:52 AM:
11:57:52 AM: success Rewriting compilation hashes - 0.001s
11:57:53 AM: warning code block or inline code language not specified in markdown. applying generic code block
11:57:53 AM: success run queries - 38.110s - 32/32 0.84/s
11:57:54 AM: success Generating image thumbnails - 1.354s - 5/5 3.69/s
11:57:54 AM:
11:57:54 AM:
11:57:54 AM: gatsby-plugin-purgecss:
11:57:54 AM: Previous CSS Size: 2359.40 KB
11:57:54 AM: New CSS Size: 32.11 KB (-98.64%)
11:57:54 AM: Removed ~2327.30 KB of CSS
11:57:54 AM:
11:57:59 AM: success Building static HTML for pages - 4.711s - 29/29 6.16/s
11:57:59 AM:
11:57:59 AM: success onPostBuild - 0.023s
11:57:59 AM: info Done building in 52.755 sec
11:57:59 AM: β
11:57:59 AM: (build.command completed in 53s)
11:57:59 AM: β
11:57:59 AM: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
11:57:59 AM: β 3. onPostBuild command from netlify-plugin-gatsby-cache β
11:57:59 AM: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
11:57:59 AM: β
11:57:59 AM: Stored the Gatsby cache to speed up future builds.
11:57:59 AM: β
11:57:59 AM: (netlify-plugin-gatsby-cache onPostBuild completed in 278ms)
11:57:59 AM: β
11:57:59 AM: βββββββββββββββββββββββββββββββ
11:57:59 AM: β Netlify Build Complete β
11:57:59 AM: βββββββββββββββββββββββββββββββ
11:57:59 AM: β
11:57:59 AM: (Netlify Build completed in 2m 51.8s)
11:57:59 AM: Caching artifacts
11:57:59 AM: Started saving node modules
11:57:59 AM: Finished saving node modules
11:57:59 AM: Started saving yarn cache
11:57:59 AM: Finished saving yarn cache
11:57:59 AM: Started saving pip cache
11:58:07 AM: Finished saving pip cache
11:58:07 AM: Started saving emacs cask dependencies
11:58:07 AM: Finished saving emacs cask dependencies
11:58:07 AM: Started saving maven dependencies
11:58:07 AM: Finished saving maven dependencies
11:58:07 AM: Started saving boot dependencies
11:58:07 AM: Finished saving boot dependencies
11:58:07 AM: Started saving go dependencies
11:58:07 AM: Finished saving go dependencies
11:58:07 AM: Build script success
11:58:07 AM: Starting to deploy site from 'public'
11:58:07 AM: Creating deploy tree
11:58:07 AM: Creating deploy upload records
11:58:07 AM: 0 new files to upload
11:58:07 AM: 0 new functions to upload
11:58:08 AM: Starting post processing
11:58:08 AM: Post processing done
11:58:09 AM: Site is live
11:59:01 AM: Finished processing build request in 4m25.850383973s
Second post plugins/cache enabled build
11:59:40 AM: Build ready to start
11:59:42 AM: build-image version: 6dfe19d15f524c85d6f9bf7df9fb30b0a9f0a61a
11:59:42 AM: build-image tag: v3.3.10
11:59:42 AM: buildbot version: 6bb3f784302b4ad90de13035b247a363a8bee34a
11:59:43 AM: Fetching cached dependencies
11:59:43 AM: Starting to download cache of 318.0MB
11:59:44 AM: Finished downloading cache in 1.749705858s
11:59:44 AM: Starting to extract cache
12:00:00 PM: Finished extracting cache in 15.289508962s
12:00:00 PM: Finished fetching cache in 17.160089283s
12:00:00 PM: Starting to prepare the repo for build
12:00:00 PM: Preparing Git Reference refs/heads/master
12:00:05 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'public' versus 'public/' in the Netlify UI
12:00:05 PM: Starting build script
12:00:05 PM: Installing dependencies
12:00:05 PM: Started restoring cached node version
12:00:09 PM: Finished restoring cached node version
12:00:10 PM: v10.20.1 is already installed.
12:00:11 PM: Now using node v10.20.1 (npm v6.14.4)
12:00:12 PM: Attempting ruby version 2.6.2, read from environment
12:00:13 PM: Using ruby version 2.6.2
12:00:13 PM: Using PHP version 5.6
12:00:14 PM: 5.2 is already installed.
12:00:14 PM: Using Swift version 5.2
12:00:14 PM: Started restoring cached node modules
12:00:14 PM: Finished restoring cached node modules
12:00:14 PM: Started restoring cached yarn cache
12:00:14 PM: Finished restoring cached yarn cache
12:00:14 PM: Installing NPM modules using Yarn version 1.17.0
12:00:15 PM: yarn install v1.17.0
12:00:15 PM: [1/4] Resolving packages...
12:00:16 PM: [2/4] Fetching packages...
12:00:44 PM: info fsevents@2.1.3: The platform "linux" is incompatible with this module.
12:00:44 PM: info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
12:00:44 PM: info fsevents@1.2.9: The platform "linux" is incompatible with this module.
12:00:44 PM: info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
12:00:44 PM: info fsevents@2.1.2: The platform "linux" is incompatible with this module.
12:00:44 PM: info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
12:00:44 PM: [3/4] Linking dependencies...
12:00:44 PM: warning "gatsby > @typescript-eslint/eslint-plugin > tsutils@3.17.1" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
12:00:44 PM: warning "gatsby-plugin-netlify > webpack-assets-manifest@3.1.1" has unmet peer dependency "webpack@>=4.4.0".
12:01:01 PM: [4/4] Building fresh packages...
12:01:07 PM: Done in 51.78s.
12:01:07 PM: NPM modules installed using Yarn
12:01:07 PM: Started restoring cached go cache
12:01:07 PM: Finished restoring cached go cache
12:01:07 PM: go version go1.12 linux/amd64
12:01:07 PM: go version go1.12 linux/amd64
12:01:07 PM: Installing missing commands
12:01:07 PM: Verify run directory
12:01:09 PM: β
12:01:09 PM: βββββββββββββββββββββββββββββββ
12:01:09 PM: β Netlify Build β
12:01:09 PM: βββββββββββββββββββββββββββββββ
12:01:09 PM: β
12:01:09 PM: β― Version
12:01:09 PM: @netlify/build 0.4.24
12:01:09 PM: β
12:01:09 PM: β― Flags
12:01:09 PM: mode: buildbot
12:01:09 PM: β
12:01:09 PM: β― Current directory
12:01:09 PM: /opt/build/repo
12:01:09 PM: β
12:01:09 PM: β― Config file
12:01:09 PM: /opt/build/repo/netlify.toml
12:01:09 PM: β
12:01:09 PM: β― Context
12:01:09 PM: production
12:01:09 PM: β
12:01:09 PM: β― Installing plugins
12:01:09 PM: - netlify-plugin-gatsby-cache
12:01:59 PM: β
12:01:59 PM: β― Loading plugins
12:01:59 PM: - netlify-plugin-gatsby-cache@0.2.1
12:01:59 PM: β
12:01:59 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
12:01:59 PM: β 1. onPreBuild command from netlify-plugin-gatsby-cache β
12:01:59 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
12:01:59 PM: β
12:01:59 PM: Found a Gatsby cache. Weβre about to go FAST. β‘οΈ
12:01:59 PM: β
12:01:59 PM: (netlify-plugin-gatsby-cache onPreBuild completed in 229ms)
12:01:59 PM: β
12:01:59 PM: ββββββββββββββββββββββββββββββββββββββ
12:01:59 PM: β 2. build.command from netlify.toml β
12:01:59 PM: ββββββββββββββββββββββββββββββββββββββ
12:01:59 PM: β
12:01:59 PM: $ gatsby build
12:02:01 PM:
12:02:01 PM: success open and validate gatsby-configs - 0.122s
12:02:02 PM:
12:02:02 PM: success load plugins - 0.903s
12:02:02 PM:
12:02:02 PM: success onPreInit - 0.002s
12:02:02 PM: success delete html and css files from previous builds - 0.022s
12:02:02 PM: success initialize cache - 0.005s
12:02:02 PM: success copy gatsby files - 0.042s
12:02:02 PM:
12:02:02 PM: success onPreBootstrap - 0.012s
12:02:02 PM: success createSchemaCustomization - 0.017s
12:02:03 PM: success source and transform nodes - 0.271s
12:02:03 PM:
12:02:03 PM: warning Plugin `gatsby-source-filesystem` tried to define built-in Gatsby GraphQL type `File`
12:02:03 PM:
12:02:03 PM:
12:02:03 PM: warning Plugin `gatsby-source-filesystem` tried to define built-in Gatsby GraphQL type `File`
12:02:03 PM:
12:02:03 PM: warning Plugin `gatsby-source-filesystem` tried to define built-in Gatsby GraphQL type `File`
12:02:03 PM: success building schema - 0.502s
12:02:03 PM:
12:02:03 PM:
12:02:03 PM: success createPages - 0.145s
12:02:03 PM: success createPagesStatefully - 0.111s
12:02:03 PM: success onPreExtractQueries - 0.000s
12:02:03 PM:
12:02:03 PM: success update schema - 0.042s
12:02:04 PM:
12:02:04 PM: success extract queries from components - 0.479s
12:02:04 PM:
12:02:04 PM: success write out requires - 0.004s
12:02:04 PM:
12:02:04 PM: success write out redirect data - 0.001s
12:02:04 PM:
12:02:04 PM: success Build manifest and related icons - 0.195s
12:02:04 PM:
12:02:04 PM: success onPostBootstrap - 0.197s
12:02:04 PM:
12:02:04 PM: β
12:02:04 PM:
12:02:04 PM: info bootstrap finished - 4.953s
12:02:04 PM: β
12:02:12 PM: Skipping purge because no template paths provided...
12:02:12 PM: Skipping purge because no template paths provided...
12:02:13 PM: warning Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
12:02:13 PM: warning Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
12:02:13 PM:
12:02:13 PM: warning Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
12:02:13 PM:
12:02:13 PM: warning Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
12:02:13 PM:
12:02:13 PM: warning Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
12:02:13 PM:
12:02:13 PM: warning Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
12:02:15 PM: Skipping purge because no template paths provided...
12:02:27 PM:
12:02:27 PM:
12:02:27 PM: gatsby-plugin-purgecss: Only processing /opt/build/repo/src/styles/style.css
12:02:41 PM:
12:02:41 PM: success Building production JavaScript and CSS bundles - 37.223s
12:02:42 PM:
12:02:42 PM: success run queries - 38.017s - 24/24 0.63/s
12:02:42 PM:
12:02:42 PM:
12:02:42 PM: gatsby-plugin-purgecss:
12:02:42 PM: Previous CSS Size: 2359.40 KB
12:02:42 PM:
12:02:42 PM: New CSS Size: 32.11 KB (-98.64%)
12:02:42 PM:
12:02:42 PM: Removed ~2327.30 KB of CSS
12:02:42 PM:
12:02:42 PM:
12:02:47 PM:
12:02:47 PM: success Building static HTML for pages - 5.164s - 29/29 5.62/s
12:02:47 PM:
12:02:47 PM:
12:02:47 PM: success onPostBuild - 0.033s
12:02:47 PM:
12:02:47 PM: info Done building in 48.261 sec
12:02:48 PM: β
12:02:48 PM: (build.command completed in 48.5s)
12:02:48 PM: β
12:02:48 PM: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
12:02:48 PM: β 3. onPostBuild command from netlify-plugin-gatsby-cache β
12:02:48 PM: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
12:02:48 PM: β
12:02:48 PM: Stored the Gatsby cache to speed up future builds.
12:02:48 PM: β
12:02:48 PM: (netlify-plugin-gatsby-cache onPostBuild completed in 344ms)
12:02:48 PM: β
12:02:48 PM: βββββββββββββββββββββββββββββββ
12:02:48 PM: β Netlify Build Complete β
12:02:48 PM: βββββββββββββββββββββββββββββββ
12:02:48 PM: β
12:02:48 PM: (Netlify Build completed in 1m 39.3s)
12:02:48 PM: Caching artifacts
12:02:48 PM: Started saving node modules
12:02:48 PM: Finished saving node modules
12:02:48 PM: Started saving yarn cache
12:02:48 PM: Finished saving yarn cache
12:02:48 PM: Started saving pip cache
12:03:01 PM: Finished saving pip cache
12:03:01 PM: Started saving emacs cask dependencies
12:03:01 PM: Finished saving emacs cask dependencies
12:03:01 PM: Started saving maven dependencies
12:03:01 PM: Finished saving maven dependencies
12:03:01 PM: Started saving boot dependencies
12:03:01 PM: Finished saving boot dependencies
12:03:01 PM: Started saving go dependencies
12:03:01 PM: Finished saving go dependencies
12:03:01 PM: Build script success
12:03:01 PM: Starting to deploy site from 'public'
12:03:01 PM: Creating deploy tree
12:03:01 PM: Creating deploy upload records
12:03:01 PM: 0 new files to upload
12:03:01 PM: 0 new functions to upload
12:03:01 PM: Starting post processing
12:03:03 PM: Post processing done
12:03:04 PM: Site is live
12:03:57 PM: Finished processing build request in 4m14.168552238s
Notice the plugin appears to install every time which is taking over a minute to do so. Is there a way to get the plugin to be cached?