Is caching builds actually slowing builds?

Our site builds are fairly long, ~10 mins for a modest NextJS site. You can see from the log that just restoring the cache takes a significant portion of the overall time:

9:51:33 AM: Starting to download cache of 5.5GB
9:51:59 AM: Finished downloading cache in 26.541369678s
9:51:59 AM: Starting to extract cache
9:55:37 AM: Finished extracting cache in 3m37.406266482s
9:55:37 AM: Finished fetching cache in 4m4.359336811s

Site:

resistbot-website-ed6e4f
Netlify App

Using the standard NextJS build plugin without any additional settings: "@netlify/plugin-nextjs": "4.2.6"

Is this excessive, and are we doing something wrong? I would have expected these builds to take something more like 5 mins? The build step takes about 1 minute, and the build steps including cache and dependency hydration takes nearly 8 minutes. Seems high!

Hey there, @embarrassment-setup :wave:

Could you share the full version of your deploy log please? Thanks so much!

Here’s a recent one:

Recent Build
7:01:19 AM: Build ready to start
7:01:21 AM: build-image version: 122b31996ccaffd45d820a452d6227f8312110cc (focal)
7:01:21 AM: build-image tag: v4.5.3
7:01:21 AM: buildbot version: 93aa77af0f8c482a6dc06593f94c9bd96f918676
7:01:21 AM: Fetching cached dependencies
7:01:22 AM: Starting to download cache of 5.5GB
7:01:52 AM: Finished downloading cache in 30.826773885s
7:01:52 AM: Starting to extract cache
7:04:57 AM: Finished extracting cache in 3m4.978386548s
7:04:58 AM: Finished fetching cache in 3m36.170047773s
7:04:58 AM: Starting to prepare the repo for build
7:04:58 AM: Preparing Git Reference refs/heads/main
7:04:59 AM: Parsing package.json dependencies
7:04:59 AM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'packages/site/.next' versus '' in the Netlify UI
7:04:59 AM: Different build command detected, going to use the one specified in the Netlify configuration file: 'yarn build' versus '' in the Netlify UI
7:05:00 AM: Starting build script
7:05:00 AM: Installing dependencies
7:05:00 AM: Python version set to 3.8
7:05:00 AM: Started restoring cached node version
7:05:13 AM: Finished restoring cached node version
7:05:13 AM: Attempting node version 'lts/*' from .node-version
7:05:13 AM: v16.14.0 is already installed.
7:05:13 AM: Now using node v16.14.0 (npm v8.3.1)
7:05:13 AM: Started restoring cached build plugins
7:05:13 AM: Finished restoring cached build plugins
7:05:14 AM: Attempting ruby version 2.7.2, read from environment
7:05:15 AM: Using ruby version 2.7.2
7:05:15 AM: Using PHP version 8.0
7:05:15 AM: WARNING: The environment variable 'NODE_ENV' is set to 'production'. Any 'devDependencies' in package.json will not be installed
7:05:15 AM: Started restoring cached yarn cache
7:08:00 AM: Finished restoring cached yarn cache
7:08:01 AM: Yarn workspaces detected
7:08:01 AM: Started restoring workspace packages/components node modules
7:08:01 AM: Finished restoring workspace packages/components node modules
7:08:01 AM: Started restoring workspace packages/site node modules
7:08:01 AM: Finished restoring workspace packages/site node modules
7:08:01 AM: Started restoring workspace packages/studio node modules
7:08:01 AM: Finished restoring workspace packages/studio node modules
7:08:01 AM: Started restoring workspace root node modules
7:08:01 AM: Finished restoring workspace root node modules
7:08:01 AM: Installing NPM modules using Yarn version 1.22.4
7:08:02 AM: yarn install v1.22.4
7:08:03 AM: [1/4] Resolving packages...
7:08:04 AM: success Already up-to-date.
7:08:04 AM: Done in 1.57s.
7:08:04 AM: NPM modules installed using Yarn
7:08:04 AM: Started restoring cached go cache
7:08:10 AM: Finished restoring cached go cache
7:08:10 AM: Installing Go version 1.14.4
7:08:10 AM: unset GOOS;
7:08:10 AM: unset GOARCH;
7:08:10 AM: export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.14.4.linux.amd64';
7:08:10 AM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.14.4.linux.amd64/bin:${PATH}";
7:08:10 AM: go version >&2;
7:08:10 AM: export GIMME_ENV='/opt/buildhome/.gimme_cache/env/go1.14.4.linux.amd64.env';
7:08:10 AM: go version go1.14.4 linux/amd64
7:08:10 AM: Installing missing commands
7:08:10 AM: Verify run directory
7:08:12 AM: ​
7:08:12 AM: ────────────────────────────────────────────────────────────────
7:08:12 AM:   Netlify Build                                                 
7:08:12 AM: ────────────────────────────────────────────────────────────────
7:08:12 AM: ​
7:08:12 AM: ❯ Version
7:08:12 AM:   @netlify/build 26.3.5
7:08:12 AM: ​
7:08:12 AM: ❯ Flags
7:08:12 AM:   baseRelDir: true
7:08:12 AM:   buildId: 6214de9f322046951042d4c4
7:08:12 AM:   deployId: 6214de9f322046951042d4c6
7:08:12 AM: ​
7:08:12 AM: ❯ Current directory
7:08:12 AM:   /opt/build/repo/packages/site
7:08:12 AM: ​
7:08:12 AM: ❯ Config file
7:08:12 AM:   /opt/build/repo/packages/site/netlify.toml
7:08:12 AM: ​
7:08:12 AM: ❯ Context
7:08:12 AM:   production
7:08:13 AM: ​
7:08:13 AM: ❯ Loading plugins
7:08:13 AM:    - @netlify/plugin-nextjs@4.2.6 from Netlify app and package.json
7:08:13 AM:    - netlify-plugin-submit-sitemap@0.2.3 from netlify.toml
7:08:13 AM:    - @sentry/netlify-build-plugin@1.1.0 from netlify.toml
7:08:13 AM:    - /plugins/netlify-honeycomb-deploy-notifier@0.0.1 from netlify.toml
7:08:13 AM: ​
7:08:13 AM: ❯ Outdated plugins
7:08:13 AM:    - @netlify/plugin-nextjs@4.2.6: latest version is 4.2.7
7:08:13 AM:      Migration guide: https://ntl.fyi/next-plugin-migration
7:08:13 AM:      To upgrade this plugin, please update its version in "package.json"
7:08:17 AM: ​
7:08:17 AM: ────────────────────────────────────────────────────────────────
7:08:17 AM:   1. @netlify/plugin-nextjs (onPreBuild event)                  
7:08:17 AM: ────────────────────────────────────────────────────────────────
7:08:17 AM: ​
7:08:21 AM: Next.js cache restored.
7:08:21 AM: Netlify configuration property "build.environment.NEXT_PRIVATE_TARGET" value changed.
7:08:21 AM: ​
7:08:21 AM: (@netlify/plugin-nextjs onPreBuild completed in 3.7s)
7:08:21 AM: ​
7:08:21 AM: ────────────────────────────────────────────────────────────────
7:08:21 AM:   2. build.command from netlify.toml                            
7:08:21 AM: ────────────────────────────────────────────────────────────────
7:08:21 AM: ​
7:08:21 AM: $ yarn build
7:08:22 AM: yarn run v1.22.4
7:08:22 AM: $ cross-env NODE_ENV=production next build
7:08:23 AM: info  - Loaded env from /opt/build/repo/packages/site/.env.production
7:08:23 AM: warn  - SWC minify beta enabled. https://nextjs.org/docs/messages/swc-minify-enabled
7:08:23 AM: info  - Checking validity of types...
7:08:23 AM: info  - Creating an optimized production build...
7:08:39 AM: info  - Compiled successfully
7:08:39 AM: info  - Collecting page data...
7:08:45 AM: info  - Generating static pages (0/19)
7:08:46 AM: info  - Generating static pages (4/19)
7:08:46 AM: info  - Generating static pages (9/19)
7:08:47 AM: info  - Generating static pages (14/19)
7:08:47 AM: Unknown block type "undefined", please specify a serializer for it in the `serializers.types` prop
7:08:47 AM: Unknown block type "undefined", please specify a serializer for it in the `serializers.types` prop
7:08:48 AM: info  - Generating static pages (19/19)
7:08:48 AM: info  - Finalizing page optimization...
7:08:48 AM: Page                                                              Size     First Load JS
7:08:48 AM: ┌ ● / (2537 ms)                                                   48.6 kB         288 kB
7:08:48 AM: ├   └ css/a53e259ad54467b4.css                                    5.7 kB
7:08:48 AM: ├   /_app                                                         0 B             112 kB
7:08:48 AM: ├ ○ /404 (334 ms)                                                 671 B           155 kB
7:08:48 AM: ├   └ css/1947f0c814c23307.css                                    1.42 kB
7:08:48 AM: ├ ○ /about                                                        8.58 kB         163 kB
7:08:48 AM: ├   └ css/3104b9be5d199575.css                                    1.65 kB
7:08:48 AM: ├ ● /donate (845 ms)                                              1.4 kB          225 kB
7:08:48 AM: ├   └ css/b7dba0db73f35501.css                                    3.2 kB
7:08:48 AM: ├ ○ /donate/crypto                                                11.3 kB         166 kB
7:08:48 AM: ├   └ css/2adf32e5e00d2bb7.css                                    1.79 kB
7:08:48 AM: ├ ○ /donate/manage                                                2.08 kB         157 kB
7:08:48 AM: ├   └ css/486d62dac3470a09.css                                    1.62 kB
7:08:48 AM: ├ λ /go/[usercode]                                                9.57 kB         171 kB
7:08:48 AM: ├   └ css/b2ced49b538a768a.css                                    3.34 kB
7:08:48 AM: ├ ○ /guide (442 ms)                                               20 kB           182 kB
7:08:48 AM: ├   └ css/43d4fa866e9eb186.css                                    2.78 kB
7:08:48 AM: ├ ● /keyword/go (430 ms)                                          9.66 kB         171 kB
7:08:48 AM: ├   └ css/ec294755f3ee71ae.css                                    2.05 kB
7:08:48 AM: ├ ● /news (1359 ms)                                               3.43 kB         206 kB
7:08:48 AM: ├   └ css/3e4c57df2fc80a76.css                                    2.88 kB
7:08:48 AM: ├ ● /news/[year]/[month]/[day]/[slug] (1211 ms)                   1.14 kB         221 kB
7:08:48 AM: ├   └ css/16b893770a9d04c3.css                                    3.03 kB
7:08:48 AM: ├   ├ /news/2022/01/22/this-seat-is-taken (424 ms)
7:08:48 AM: ├   ├ /news/2022/02/14/don-t-destroy-section-230-fix-it (419 ms)
7:08:48 AM: ├   └ /news/2022/01/15/the-hallway-commute (368 ms)
7:08:48 AM: ├ ● /news/category/[category] (3726 ms)                           2.08 kB         205 kB
7:08:48 AM: ├   └ css/ed933b9e0b6f7d39.css                                    2.35 kB
7:08:48 AM: ├   ├ /news/category/national (1875 ms)
7:08:48 AM: ├   ├ /news/category/resistbot (962 ms)
7:08:48 AM: ├   └ /news/category/state (889 ms)
7:08:48 AM: ├ ● /petitions (ISR: 60 Seconds) (1519 ms)                        4.94 kB         159 kB
7:08:48 AM: ├   └ css/da6bd364dd2728bd.css                                    2.68 kB
7:08:48 AM: ├ λ /petitions/[sharecode]                                        3.52 kB         175 kB
7:08:48 AM: ├   └ css/dc5e98cbb32ddcf2.css                                    2.95 kB
7:08:48 AM: ├ ○ /privacy (338 ms)                                             6.9 kB          161 kB
7:08:48 AM: ├   └ css/5296d008e69d609f.css                                    1.42 kB
7:08:48 AM: ├ ○ /rights                                                       2.56 kB         157 kB
7:08:48 AM: ├   └ css/17fb36ad8f9bbb25.css                                    1.47 kB
7:08:48 AM: └ ○ /terms (439 ms)                                               10.3 kB         165 kB
7:08:48 AM:     └ css/38fecfe36c1f45e0.css                                    1.4 kB
7:08:48 AM: + First Load JS shared by all                                     112 kB
7:08:48 AM:   ├ chunks/framework-c5c03b52f4e5f92b.js                          42.4 kB
7:08:48 AM:   ├ chunks/main-91e14667d534a2a3.js                               27.1 kB
7:08:48 AM:   ├ chunks/pages/_app-d391b60775e7be5b.js                         40.2 kB
7:08:48 AM:   ├ chunks/webpack-fb90230e81cca6ee.js                            2.62 kB
7:08:48 AM:   └ css/162060b5ee1a3a55.css                                      806 B
7:08:48 AM: λ  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
7:08:48 AM: ○  (Static)  automatically rendered as static HTML (uses no initial props)
7:08:48 AM: ●  (SSG)     automatically generated as static HTML + JSON (uses getStaticProps)
7:08:48 AM:    (ISR)     incremental static regeneration (uses revalidate in getStaticProps)
7:08:49 AM: $ next-sitemap
7:08:49 AM: Loaded env from /opt/build/repo/packages/site/.env.production
7:08:49 AM: ✅ [next-sitemap] Generated index sitemap and 1 sitemap(s)
7:08:49 AM:    ○ https://resist.bot/sitemap.xml (index)
7:08:49 AM:    ○ https://resist.bot/sitemap-0.xml
7:08:49 AM: Done in 27.17s.
7:08:49 AM: ​
7:08:49 AM: (build.command completed in 27.4s)
7:08:49 AM: ​
7:08:49 AM: ────────────────────────────────────────────────────────────────
7:08:49 AM:   3. @netlify/plugin-nextjs (onBuild event)                     
7:08:49 AM: ────────────────────────────────────────────────────────────────
7:08:49 AM: ​
7:08:49 AM: Patching /opt/build/repo/node_modules/next/dist/server/base-server.js
7:08:49 AM: Done
7:08:49 AM: Moving static page files to serve from CDN...
7:08:49 AM: Moved 27 files
7:08:49 AM: Netlify configuration property "redirects" value changed to [
7:08:49 AM:   {
7:08:49 AM:     from: '/petitions/trending',
7:08:49 AM:     query: {},
7:08:49 AM:     to: '/petitions',
7:08:49 AM:     status: 301,
7:08:49 AM:     force: true,
7:08:49 AM:     conditions: {},
7:08:49 AM:     headers: {}
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/podcasts/live',
7:08:49 AM:     query: {},
7:08:49 AM:     to: 'https://resistbot.live',
7:08:49 AM:     status: 302,
7:08:49 AM:     force: true,
7:08:49 AM:     conditions: {},
7:08:49 AM:     headers: {}
7:08:49 AM:   },
7:08:49 AM:   { from: '/_next/static/*', to: '/static/:splat', status: 200 },
7:08:49 AM:   {
7:08:49 AM:     from: '/_next/image/*',
7:08:49 AM:     query: { url: ':url', w: ':width', q: ':quality' },
7:08:49 AM:     to: '/_ipx/w_:width,q_:quality/:url',
7:08:49 AM:     status: 301
7:08:49 AM:   },
7:08:49 AM:   { from: '/_ipx/*', to: '/.netlify/builders/_ipx', status: 200 },
7:08:49 AM:   { from: '/cache/*', to: '/404.html', status: 404, force: true },
7:08:49 AM:   { from: '/server/*', to: '/404.html', status: 404, force: true },
7:08:49 AM:   { from: '/serverless/*', to: '/404.html', status: 404, force: true },
7:08:49 AM:   { from: '/traces', to: '/404.html', status: 404, force: true },
7:08:49 AM:   {
7:08:49 AM:     from: '/routes-manifest.json',
7:08:49 AM:     to: '/404.html',
7:08:49 AM:     status: 404,
7:08:49 AM:     force: true
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/build-manifest.json',
7:08:49 AM:     to: '/404.html',
7:08:49 AM:     status: 404,
7:08:49 AM:     force: true
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/prerender-manifest.json',
7:08:49 AM:     to: '/404.html',
7:08:49 AM:     status: 404,
7:08:49 AM:     force: true
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/react-loadable-manifest.json',
7:08:49 AM:     to: '/404.html',
7:08:49 AM:     status: 404,
7:08:49 AM:     force: true
7:08:49 AM:   },
7:08:49 AM:   { from: '/BUILD_ID', to: '/404.html', status: 404, force: true },
7:08:49 AM:   {
7:08:49 AM:     from: '/api',
7:08:49 AM:     to: '/.netlify/functions/___netlify-handler',
7:08:49 AM:     status: 200
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/api/*',
7:08:49 AM:     to: '/.netlify/functions/___netlify-handler',
7:08:49 AM:     status: 200
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/feed.atom',
7:08:49 AM:     to: '/feed.atom',
7:08:49 AM:     conditions: { Cookie: [Array] },
7:08:49 AM:     status: 200
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/feed.json',
7:08:49 AM:     to: '/feed.json',
7:08:49 AM:     conditions: { Cookie: [Array] },
7:08:49 AM:     status: 200
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/feed.xml',
7:08:49 AM:     to: '/feed.xml',
7:08:49 AM:     conditions: { Cookie: [Array] },
7:08:49 AM:     status: 200
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/manifest.json',
7:08:49 AM:     to: '/manifest.json',
7:08:49 AM:     conditions: { Cookie: [Array] },
7:08:49 AM:     status: 200
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/resistbot.vcf',
7:08:49 AM:     to: '/resistbot.vcf',
7:08:49 AM:     conditions: { Cookie: [Array] },
7:08:49 AM:     status: 200
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/robots.txt',
7:08:49 AM:     to: '/robots.txt',
7:08:49 AM:     conditions: { Cookie: [Array] },
7:08:49 AM:     status: 200
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/sitemap-0.xml',
7:08:49 AM:     to: '/sitemap-0.xml',
7:08:49 AM:     conditions: { Cookie: [Array] },
7:08:49 AM:     status: 200
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/sitemap.xml',
7:08:49 AM:     to: '/sitemap.xml',
7:08:49 AM:     conditions: { Cookie: [Array] },
7:08:49 AM:     status: 200
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/favicons/icon-144x144.png',
7:08:49 AM:     to: '/favicons/icon-144x144.png',
7:08:49 AM:     conditions: { Cookie: [Array] },
7:08:49 AM:     status: 200
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/favicons/icon-168x168.png',
7:08:49 AM:     to: '/favicons/icon-168x168.png',
7:08:49 AM:     conditions: { Cookie: [Array] },
7:08:49 AM:     status: 200
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/favicons/icon-192x192.png',
7:08:49 AM:     to: '/favicons/icon-192x192.png',
7:08:49 AM:     conditions: { Cookie: [Array] },
7:08:49 AM:     status: 200
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/favicons/icon-256x256.png',
7:08:49 AM:     to: '/favicons/icon-256x256.png',
7:08:49 AM:     conditions: { Cookie: [Array] },
7:08:49 AM:     status: 200
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/favicons/icon-384x384.png',
7:08:49 AM:     to: '/favicons/icon-384x384.png',
7:08:49 AM:     conditions: { Cookie: [Array] },
7:08:49 AM:     status: 200
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/favicons/icon-48x48.png',
7:08:49 AM:     to: '/favicons/icon-48x48.png',
7:08:49 AM:     conditions: { Cookie: [Array] },
7:08:49 AM:     status: 200
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/favicons/icon-512x512.png',
7:08:49 AM:     to: '/favicons/icon-512x512.png',
7:08:49 AM:     conditions: { Cookie: [Array] },
7:08:49 AM:     status: 200
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/favicons/icon-72x72.png',
7:08:49 AM:     to: '/favicons/icon-72x72.png',
7:08:49 AM:     conditions: { Cookie: [Array] },
7:08:49 AM:     status: 200
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/favicons/icon-96x96.png',
7:08:49 AM:     to: '/favicons/icon-96x96.png',
7:08:49 AM:     conditions: { Cookie: [Array] },
7:08:49 AM:     status: 200
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/*',
7:08:49 AM:     to: '/.netlify/functions/___netlify-handler',
7:08:49 AM:     status: 200,
7:08:49 AM:     conditions: { Cookie: [Array] },
7:08:49 AM:     force: true
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/_next/data/build/petitions.json',
7:08:49 AM:     to: '/.netlify/builders/___netlify-odb-handler',
7:08:49 AM:     status: 200,
7:08:49 AM:     force: true
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/petitions',
7:08:49 AM:     to: '/.netlify/builders/___netlify-odb-handler',
7:08:49 AM:     status: 200,
7:08:49 AM:     force: true
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/_next/data/build/404.json',
7:08:49 AM:     to: '/.netlify/functions/___netlify-handler',
7:08:49 AM:     status: 200,
7:08:49 AM:     force: false
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/404',
7:08:49 AM:     to: '/.netlify/functions/___netlify-handler',
7:08:49 AM:     status: 200,
7:08:49 AM:     force: false
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/_next/data/build/about.json',
7:08:49 AM:     to: '/.netlify/functions/___netlify-handler',
7:08:49 AM:     status: 200,
7:08:49 AM:     force: false
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/about',
7:08:49 AM:     to: '/.netlify/functions/___netlify-handler',
7:08:49 AM:     status: 200,
7:08:49 AM:     force: false
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/_next/data/build/donate/crypto.json',
7:08:49 AM:     to: '/.netlify/functions/___netlify-handler',
7:08:49 AM:     status: 200,
7:08:49 AM:     force: false
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/donate/crypto',
7:08:49 AM:     to: '/.netlify/functions/___netlify-handler',
7:08:49 AM:     status: 200,
7:08:49 AM:     force: false
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/_next/data/build/donate/manage.json',
7:08:49 AM:     to: '/.netlify/functions/___netlify-handler',
7:08:49 AM:     status: 200,
7:08:49 AM:     force: false
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/donate/manage',
7:08:49 AM:     to: '/.netlify/functions/___netlify-handler',
7:08:49 AM:     status: 200,
7:08:49 AM:     force: false
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/_next/data/build/guide.json',
7:08:49 AM:     to: '/.netlify/functions/___netlify-handler',
7:08:49 AM:     status: 200,
7:08:49 AM:     force: false
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/guide',
7:08:49 AM:     to: '/.netlify/functions/___netlify-handler',
7:08:49 AM:     status: 200,
7:08:49 AM:     force: false
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/_next/data/build/privacy.json',
7:08:49 AM:     to: '/.netlify/functions/___netlify-handler',
7:08:49 AM:     status: 200,
7:08:49 AM:     force: false
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/privacy',
7:08:49 AM:     to: '/.netlify/functions/___netlify-handler',
7:08:49 AM:     status: 200,
7:08:49 AM:     force: false
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/_next/data/build/rights.json',
7:08:49 AM:     to: '/.netlify/functions/___netlify-handler',
7:08:49 AM:     status: 200,
7:08:49 AM:     force: false
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/rights',
7:08:49 AM:     to: '/.netlify/functions/___netlify-handler',
7:08:49 AM:     status: 200,
7:08:49 AM:     force: false
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/_next/data/build/terms.json',
7:08:49 AM:     to: '/.netlify/functions/___netlify-handler',
7:08:49 AM:     status: 200,
7:08:49 AM:     force: false
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/terms',
7:08:49 AM:     to: '/.netlify/functions/___netlify-handler',
7:08:49 AM:     status: 200,
7:08:49 AM:     force: false
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/_next/data/build/go/:usercode.json',
7:08:49 AM:     to: '/.netlify/functions/___netlify-handler',
7:08:49 AM:     status: 200,
7:08:49 AM:     force: false
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/go/:usercode',
7:08:49 AM:     to: '/.netlify/functions/___netlify-handler',
7:08:49 AM:     status: 200,
7:08:49 AM:     force: false
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/_next/data/build/news/category/:category.json',
7:08:49 AM:     to: '/.netlify/builders/___netlify-odb-handler',
7:08:49 AM:     status: 200,
7:08:49 AM:     force: false
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/news/category/:category',
7:08:49 AM:     to: '/.netlify/builders/___netlify-odb-handler',
7:08:49 AM:     status: 200,
7:08:49 AM:     force: false
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/_next/data/build/news/:year/:month/:day/:slug.json',
7:08:49 AM:     to: '/.netlify/builders/___netlify-odb-handler',
7:08:49 AM:     status: 200,
7:08:49 AM:     force: false
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/news/:year/:month/:day/:slug',
7:08:49 AM:     to: '/.netlify/builders/___netlify-odb-handler',
7:08:49 AM:     status: 200,
7:08:49 AM:     force: false
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/_next/data/build/petitions/:sharecode.json',
7:08:49 AM:     to: '/.netlify/functions/___netlify-handler',
7:08:49 AM:     status: 200,
7:08:49 AM:     force: false
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/petitions/:sharecode',
7:08:49 AM:     to: '/.netlify/functions/___netlify-handler',
7:08:49 AM:     status: 200,
7:08:49 AM:     force: false
7:08:49 AM:   },
7:08:49 AM:   {
7:08:49 AM:     from: '/*',
7:08:49 AM:     to: '/.netlify/functions/___netlify-handler',
7:08:49 AM:     status: 200
7:08:49 AM:   }
7:08:49 AM: ].
7:08:49 AM: ​
7:08:49 AM: (@netlify/plugin-nextjs onBuild completed in 153ms)
7:08:49 AM: ​
7:08:49 AM: ────────────────────────────────────────────────────────────────
7:08:49 AM:   4. Functions bundling                                         
7:08:49 AM: ────────────────────────────────────────────────────────────────
7:08:49 AM: ​
7:08:49 AM: Packaging Functions from .netlify/functions-internal directory:
7:08:49 AM:  - ___netlify-handler/___netlify-handler.js
7:08:49 AM:  - ___netlify-odb-handler/___netlify-odb-handler.js
7:08:49 AM:  - _ipx/_ipx.js
7:08:49 AM: ​
7:09:54 AM: ​
7:09:54 AM: (Functions bundling completed in 1m 4.7s)
7:09:54 AM: ​
7:09:54 AM: ────────────────────────────────────────────────────────────────
7:09:54 AM:   5. @netlify/plugin-nextjs (onPostBuild event)                 
7:09:54 AM: ────────────────────────────────────────────────────────────────
7:09:54 AM: ​
7:09:56 AM: Next.js cache saved.
7:09:56 AM: ​
7:09:56 AM: (@netlify/plugin-nextjs onPostBuild completed in 2.3s)
7:09:56 AM: ​
7:09:56 AM: ────────────────────────────────────────────────────────────────
7:09:56 AM:   6. @sentry/netlify-build-plugin (onPostBuild event)           
7:09:56 AM: ────────────────────────────────────────────────────────────────
7:09:56 AM: ​
7:09:56 AM: Creating new release with version:  f821bfa505d83ee4bca4ce2c92024cd0b6b56189
7:09:56 AM: > Found 181 release files
7:09:56 AM: > Analyzing 181 sources
7:09:57 AM: > Rewriting sources
7:09:58 AM: > Adding source map references
7:09:59 AM: > Bundled 181 files for upload
7:09:59 AM: > Uploaded release files to Sentry
7:09:59 AM: > File upload complete (processing pending on server)
7:09:59 AM: Source Map Upload Report
7:09:59 AM:   Scripts
7:09:59 AM:     ~/server/chunks/10.js
 numerous files removed for length
7:09:59 AM:     ~/static/css/ed933b9e0b6f7d39.css.map
7:10:00 AM: Successfully notified Sentry of deployment!
7:10:00 AM: ​
7:10:00 AM: (@sentry/netlify-build-plugin onPostBuild completed in 4.1s)
7:10:00 AM: ​
7:10:00 AM: ────────────────────────────────────────────────────────────────
7:10:00 AM:   7. Deploy site                                                
7:10:00 AM: ────────────────────────────────────────────────────────────────
7:10:00 AM: ​
7:10:00 AM: Starting to deploy site from 'packages/site/.next'
7:10:03 AM: Creating deploy tree asynchronously
7:10:03 AM: Creating deploy upload records
7:10:05 AM: 45 new files to upload
7:10:05 AM: 2 new functions to upload
7:10:15 AM: Starting post processing
7:10:15 AM: Skipping HTML post processing
7:10:15 AM: Post processing - header rules
7:10:15 AM: Post processing - redirect rules
7:10:15 AM: Post processing done
7:10:17 AM: Site is live ✨
7:10:18 AM: Finished waiting for live deploy in 4.084988004s
7:10:18 AM: Site deploy was successfully initiated
7:10:18 AM: ​
7:10:18 AM: (Deploy site completed in 18.4s)
7:10:18 AM: ​
7:10:18 AM: ────────────────────────────────────────────────────────────────
7:10:18 AM:   8. netlify-plugin-submit-sitemap (onSuccess event)            
7:10:18 AM: ────────────────────────────────────────────────────────────────
7:10:18 AM: ​
7:10:18 AM: Going to submit sitemap to google
7:10:18 AM:  --> URL: https://www.google.com/ping?sitemap=https://resist.bot/sitemap.xml
7:10:19 AM: Going to submit sitemap to bing
7:10:19 AM:  --> URL: https://www.bing.com/ping?sitemap=https://resist.bot/sitemap.xml
7:10:19 AM:  ✓  DONE! Sitemap submitted succesfully to google 
7:10:19 AM:  ✓  DONE! Sitemap submitted succesfully to bing 
7:10:19 AM: ​
7:10:19 AM: (netlify-plugin-submit-sitemap onSuccess completed in 252ms)
7:10:19 AM: ​
7:10:19 AM: ───────────────────────────────────────────────────────────────────
7:10:19 AM:   9. /plugins/netlify-honeycomb-deploy-notifier (onSuccess event)  
7:10:19 AM: ───────────────────────────────────────────────────────────────────
7:10:19 AM: ​
7:10:19 AM: Created Deploy Marker in Honeycomb: cuKQDtQs52E
7:10:19 AM: ​
7:10:19 AM: (/plugins/netlify-honeycomb-deploy-notifier onSuccess completed in 208ms)
7:10:19 AM: ​
7:10:19 AM: ────────────────────────────────────────────────────────────────
7:10:19 AM:   Netlify Build Complete                                        
7:10:19 AM: ────────────────────────────────────────────────────────────────
7:10:19 AM: ​
7:10:19 AM: (Netlify Build completed in 2m 6.9s)
7:10:20 AM: Caching artifacts
7:10:20 AM: Started saving workspace packages/components node modules
7:10:20 AM: Finished saving workspace packages/components node modules
7:10:20 AM: Started saving workspace packages/site node modules
7:10:20 AM: Finished saving workspace packages/site node modules
7:10:20 AM: Started saving workspace packages/studio node modules
7:10:20 AM: Finished saving workspace packages/studio node modules
7:10:20 AM: Started saving workspace root node modules
7:10:20 AM: Finished saving workspace root node modules
7:10:20 AM: Started saving build plugins
7:10:20 AM: Finished saving build plugins
7:10:20 AM: Started saving yarn cache
7:12:33 AM: Finished saving yarn cache
7:12:33 AM: Started saving pip cache
7:12:33 AM: Finished saving pip cache
7:12:33 AM: Started saving emacs cask dependencies
7:12:33 AM: Finished saving emacs cask dependencies
7:12:33 AM: Started saving maven dependencies
7:12:33 AM: Finished saving maven dependencies
7:12:33 AM: Started saving boot dependencies
7:12:33 AM: Finished saving boot dependencies
7:12:33 AM: Started saving rust rustup cache
7:12:33 AM: Finished saving rust rustup cache
7:12:33 AM: Started saving go dependencies
7:12:37 AM: Finished saving go dependencies
7:12:37 AM: Build script success
7:27:59 AM: Finished processing build request in 26m38.001759757s

Hey @embarrassment-setup,

Do you know how big your repository is and what is the size of your node_modules folder? In most cases, those are the things that add up to the cache.

I’m not sure how that’s relevant? The build cache using defaults provided by the nextjs plugin generates a cache of nearly 6GB and I’m trying to understand if that’s “normal” or I’m using it ineffectively? Since I’m just using all the defaults I don’t have a reference point to know if this is optimal. Other than local yarn install that takes much less than 5 minutes. If you need specifics that aren’t contained in this configuration description I can try to provide more.

Hey @embarrassment-setup ,

The size of the repo and node_modules folder affects cache size and the time it takes to download and extract them so anything you can do to minimize the size helps.

Another thing you can try is using plugins like this one to peer inside the cache during build to see what’s in there:

My guess would be that your repo has a large history - we do cache the repo along with your dependencies and anything else you cram into the cache. To fix that you’d need to reduce the history of your repo, which I realize might not be an easy lift (most people who do this create a fork or something and archive the old one to keep history without needing to download it with git clone).

I do hope this helps. Please keep us posted!

I used that plugin, the resulting file has things I’d nominally expect for Next.js but it also seems to be missing a lot (like node things, a git repo, as you note, etc). This file comes out to 1 GB which is a long ways from the nearly 6GB the build is reporting. It even seems like it’s growing. Are there no other tools available to me to debug this besides printing out what it this other plugin tells me?

Summary
4:37:59 PM: Fetching cached dependencies
4:37:59 PM: Starting to download cache of 5.9GB
4:38:49 PM: Finished downloading cache in 50.166737894s
4:38:49 PM: Starting to extract cache
4:42:27 PM: Finished extracting cache in 3m37.626769742s
4:42:27 PM: Finished fetching cache in 4m28.170095777s

Thanks for trying the plugin. Could you also provide us with the size of your GitHub repo as well as the size of your Node Modules folder? We need that information to debug further. Thank you!

Locally on disk it looks like node_modules is ~1GB, and the git repo is apparently 90MB.

$ git count-objects -vH
count: 6446
size: 90.60 MiB
in-pack: 19261
packs: 32
size-pack: 254.38 MiB
prune-packable: 448
garbage: 0
size-garbage: 0 bytes

I did a new build WITH deleting the cache and that cut off like 4 minutes from the build, so something really appears to be accruing over time and not getting removed?

Hey @embarrassment-setup,

I’ve shared the build cache with your forums email address. Feel free to download it and check it out. Note that, the unzipped version is around 15 GB.

You can check it and let us know what seems to be a problem in that.

Repo is 190MB, the rest is … well huge. Something in js-workspaces takes up the massive majority.

So, back to the original issue - I’m using the standard netlify plugin and it seems to never make the cache smaller.

Hey there, @embarrassment-setup :wave:

Thanks for your patience here. We have been a bit underwater. I think the missing information we need here is what is causing the 15GB of cache in the js-workspaces. Have you investigated the file in Google Drive that @hrishikesh added you to? Additionally, can you please try manually clearing your cache to see if this addresses the issue.

Once you provide this information to us, we can determine next steps.