Hi,
Iβm trying to build a headless wordpress with nextjs and deploy on Netify. Iβm using a starter template from GitHub - colbyfayock/next-wordpress-starter: π Bring WordPress to the static world with Next.js.
Iβve watched the video tutorial Automatically Update Static Content in Next.js with ISR - YouTube and follow the same steps to set up the ISR properly by adding revalidate: 10 to getStaticProps(). Itβs working perfectly on local host. The problem is, after deploying it on Netlify, the ISR is not working anymore.
Any help would be greatly appreciated!
The frontend can be found from https://main--bright-nougat-01bbb4.netlify.app/, while the wordpress can be found from https://test.transitgraphics-clientserver.com.au/.
Please find ISR handler log as below:
May 16, 01:21:01 PM: 8a873fe4 INFO [GET] / (ODB TTL=60)
May 16, 01:21:04 PM: 8a873fe4 Duration: 1412.20 ms Memory Usage: 134 MB Init Duration: 550.23 ms
May 16, 01:21:04 PM: d7ebd7d0 INFO [GET] /_next/data/6RFBwkNZc4PrDZv2-V3Um/posts/test6.json (ODB TTL=60)
May 16, 01:21:04 PM: d907d33c INFO [GET] /_next/data/6RFBwkNZc4PrDZv2-V3Um/authors/admin.json (ODB TTL=60)
May 16, 01:21:04 PM: a15112e6 INFO [GET] /_next/data/6RFBwkNZc4PrDZv2-V3Um/categories/uncategorized.json (ODB TTL=60)
May 16, 01:21:04 PM: ded6fe61 INFO [GET] /_next/data/6RFBwkNZc4PrDZv2-V3Um/posts/test.json (ODB TTL=60)
May 16, 01:21:04 PM: 0d68072a INFO [GET] /_next/data/6RFBwkNZc4PrDZv2-V3Um/index.json (ODB TTL=60)
May 16, 01:21:04 PM: d7ebd7d0 Duration: 22.96 ms Memory Usage: 135 MB
May 16, 01:21:06 PM: ded6fe61 Duration: 1362.45 ms Memory Usage: 133 MB Init Duration: 559.72 ms
May 16, 01:21:06 PM: 0d68072a Duration: 1310.08 ms Memory Usage: 134 MB Init Duration: 513.53 ms
May 16, 01:21:11 PM: d907d33c Duration: 6568.21 ms Memory Usage: 175 MB
May 16, 01:21:13 PM: a15112e6 Duration: 7642.27 ms Memory Usage: 173 MB Init Duration: 619.79 ms
May 16, 01:21:44 PM: a4dbd935 INFO [GET] /_next/data/6RFBwkNZc4PrDZv2-V3Um/posts/test-new.json (ODB TTL=60)
May 16, 01:21:45 PM: a4dbd935 Duration: 123.37 ms Memory Usage: 173 MB
May 16, 01:22:19 PM: d54cf2c0 INFO [GET] /_next/data/6RFBwkNZc4PrDZv2-V3Um/posts/dolor-ut-vero-totam-cumque-at.json (ODB TTL=60)
May 16, 01:22:20 PM: d54cf2c0 Duration: 109.33 ms Memory Usage: 175 MB
May 16, 01:26:14 PM: 5e4eef5c INFO [GET] /_next/data/6RFBwkNZc4PrDZv2-V3Um/posts/hello-world.json (ODB TTL=60)
May 16, 01:26:14 PM: f7e7f186 INFO [GET] /_next/data/6RFBwkNZc4PrDZv2-V3Um/posts/molestias-iure-quidem-culpa-blanditiis-laboriosam-corporis.json (ODB TTL=60)
May 16, 01:26:14 PM: 5e4eef5c Duration: 6.01 ms Memory Usage: 176 MB
May 16, 01:26:14 PM: 15e2e276 INFO [GET] /_next/data/6RFBwkNZc4PrDZv2-V3Um/posts/quae-magnam-deleniti-molestias-sed-ut.json (ODB TTL=60)
May 16, 01:26:14 PM: 6f191d87 INFO [GET] /_next/data/6RFBwkNZc4PrDZv2-V3Um/posts/est-beatae-ab-nihil-laborum-omnis.json (ODB TTL=60)
May 16, 01:26:19 PM: f7e7f186 Duration: 5024.48 ms Memory Usage: 176 MB
May 16, 01:26:20 PM: 15e2e276 Duration: 5450.67 ms Memory Usage: 175 MB
May 16, 01:26:20 PM: 6f191d87 Duration: 5642.75 ms Memory Usage: 163 MB
May 16, 01:26:26 PM: 72291485 INFO [GET] /posts/test-7/ (ODB TTL=60)
May 16, 01:26:31 PM: 72291485 Duration: 5121.73 ms Memory Usage: 163 MB
May 16, 01:26:31 PM: 7b6e4e65 INFO [GET] /_next/data/6RFBwkNZc4PrDZv2-V3Um/categories.json (ODB TTL=60)
May 16, 01:26:31 PM: e2944550 INFO [GET] /_next/data/6RFBwkNZc4PrDZv2-V3Um/posts.json (ODB TTL=60)
May 16, 01:26:31 PM: 4d3887bc INFO [GET] /_next/data/6RFBwkNZc4PrDZv2-V3Um/posts/test-7.json (ODB TTL=60)
May 16, 01:26:31 PM: 7b6e4e65 Duration: 8.54 ms Memory Usage: 163 MB
May 16, 01:26:31 PM: e2944550 Duration: 6.40 ms Memory Usage: 176 MB
May 16, 01:26:37 PM: 4d3887bc Duration: 5126.73 ms Memory Usage: 175 MB
May 16, 02:04:55 PM: 35c94264 INFO [GET] /_next/data/6RFBwkNZc4PrDZv2-V3Um/ (ODB TTL=60)
May 16, 02:04:55 PM: 35c94264 Duration: 23.50 ms Memory Usage: 158 MB
May 16, 02:11:22 PM: 60a3d203 INFO [GET] / (ODB TTL=60)
May 16, 02:11:24 PM: 60a3d203 Duration: 1419.67 ms Memory Usage: 135 MB Init Duration: 518.15 ms
May 16, 02:11:24 PM: d061ec00 INFO [GET] /_next/data/cQAROQN455uUS8Q743oP0/posts/test-7.json (ODB TTL=60)
May 16, 02:11:24 PM: 17c61f0a INFO [GET] /_next/data/cQAROQN455uUS8Q743oP0/authors/admin.json (ODB TTL=60)
May 16, 02:11:24 PM: ecdb3016 INFO [GET] /_next/data/cQAROQN455uUS8Q743oP0/posts/test.json (ODB TTL=60)
May 16, 02:11:24 PM: acd96cae INFO [GET] /_next/data/cQAROQN455uUS8Q743oP0/posts/test6.json (ODB TTL=60)
May 16, 02:11:24 PM: a85a3dbf INFO [GET] /_next/data/cQAROQN455uUS8Q743oP0/categories/uncategorized.json (ODB TTL=60)
May 16, 02:11:24 PM: e404d346 INFO [GET] /_next/data/cQAROQN455uUS8Q743oP0/index.json (ODB TTL=60)
May 16, 02:11:24 PM: d061ec00 Duration: 20.65 ms Memory Usage: 135 MB
May 16, 02:11:27 PM: ecdb3016 Duration: 1259.10 ms Memory Usage: 131 MB Init Duration: 550.67 ms
May 16, 02:11:27 PM: e404d346 Duration: 1308.17 ms Memory Usage: 135 MB Init Duration: 519.57 ms
May 16, 02:11:27 PM: acd96cae Duration: 1334.78 ms Memory Usage: 137 MB Init Duration: 537.88 ms
May 16, 02:11:30 PM: 17c61f0a Duration: 5362.56 ms Memory Usage: 175 MB
May 16, 02:11:32 PM: a85a3dbf Duration: 6644.02 ms Memory Usage: 175 MB Init Duration: 525.27 ms
May 16, 02:12:14 PM: 9702b336 INFO [GET] /_next/data/6RFBwkNZc4PrDZv2-V3Um/posts/test.json (ODB TTL=60)
May 16, 02:12:15 PM: 9702b336 Duration: 117.59 ms Memory Usage: 175 MB
May 16, 02:12:15 PM: a9d2e1cb INFO [GET] /_next/data/cQAROQN455uUS8Q743oP0/posts/test-new.json (ODB TTL=60)
May 16, 02:12:16 PM: a9d2e1cb Duration: 119.42 ms Memory Usage: 175 MB
May 16, 02:19:03 PM: 97e0cc1b INFO [GET] / (ODB TTL=60)
May 16, 02:19:04 PM: 028ec845 INFO [GET] / (ODB TTL=60)
May 16, 02:19:06 PM: 97e0cc1b Duration: 1436.99 ms Memory Usage: 134 MB Init Duration: 575.33 ms
May 16, 02:19:06 PM: 028ec845 Duration: 1417.39 ms Memory Usage: 141 MB Init Duration: 505.52 ms
May 16, 02:19:06 PM: 52e3a70b INFO [GET] /_next/data/st-TkfJeANHpBLi-Jk9CQ/authors/admin.json (ODB TTL=60)
May 16, 02:19:06 PM: 6d54465d INFO [GET] /_next/data/st-TkfJeANHpBLi-Jk9CQ/posts/test6.json (ODB TTL=60)
May 16, 02:19:06 PM: f6b4d739 INFO [GET] /_next/data/st-TkfJeANHpBLi-Jk9CQ/posts/test-7.json (ODB TTL=60)
May 16, 02:19:06 PM: b57fdba8 INFO [GET] /_next/data/st-TkfJeANHpBLi-Jk9CQ/categories/uncategorized.json (ODB TTL=60)
May 16, 02:19:06 PM: 8e88389e INFO [GET] /_next/data/st-TkfJeANHpBLi-Jk9CQ/posts/test.json (ODB TTL=60)
May 16, 02:19:06 PM: fa316bc1 INFO [GET] /_next/data/st-TkfJeANHpBLi-Jk9CQ/index.json (ODB TTL=60)
May 16, 02:19:06 PM: f6b4d739 Duration: 27.39 ms Memory Usage: 135 MB
May 16, 02:19:06 PM: 6d54465d Duration: 9.76 ms Memory Usage: 135 MB
May 16, 02:19:07 PM: b17add85 INFO [GET] /_next/data/st-TkfJeANHpBLi-Jk9CQ/index.json (ODB TTL=60)
May 16, 02:19:07 PM: 88aa20ea INFO [GET] /_next/data/st-TkfJeANHpBLi-Jk9CQ/authors/admin.json (ODB TTL=60)
May 16, 02:19:07 PM: ec94fd57 INFO [GET] /_next/data/st-TkfJeANHpBLi-Jk9CQ/categories/uncategorized.json (ODB TTL=60)
May 16, 02:19:07 PM: a0434029 INFO [GET] /_next/data/st-TkfJeANHpBLi-Jk9CQ/posts/test.json (ODB TTL=60)
May 16, 02:19:07 PM: 255014f4 INFO [GET] /_next/data/st-TkfJeANHpBLi-Jk9CQ/posts/test-new.json (ODB TTL=60)
May 16, 02:19:07 PM: 7e731a05 INFO [GET] /posts/page/2 (ODB)
May 16, 02:19:08 PM: b217cbf1 INFO [GET] /_next/data/st-TkfJeANHpBLi-Jk9CQ/posts.json (ODB TTL=60)
May 16, 02:19:08 PM: f0f75672 INFO [GET] /_next/data/st-TkfJeANHpBLi-Jk9CQ/posts/dolor-ut-vero-totam-cumque-at.json (ODB TTL=60)
May 16, 02:19:08 PM: a809c2b7 INFO [GET] /_next/data/st-TkfJeANHpBLi-Jk9CQ/categories.json (ODB TTL=60)
May 16, 02:19:08 PM: 7e731a05 Duration: 115.32 ms Memory Usage: 100 MB Init Duration: 538.79 ms
May 16, 02:19:08 PM: 8e88389e Duration: 1294.88 ms Memory Usage: 131 MB Init Duration: 499.53 ms
May 16, 02:19:08 PM: fa316bc1 Duration: 1336.51 ms Memory Usage: 140 MB Init Duration: 501.82 ms
May 16, 02:19:08 PM: b17add85 Duration: 1341.18 ms Memory Usage: 133 MB Init Duration: 537.30 ms
May 16, 02:19:09 PM: a0434029 Duration: 1256.21 ms Memory Usage: 133 MB Init Duration: 496.38 ms
May 16, 02:19:09 PM: 255014f4 Duration: 1313.51 ms Memory Usage: 132 MB Init Duration: 526.98 ms
May 16, 02:19:10 PM: f0f75672 Duration: 1275.15 ms Memory Usage: 132 MB Init Duration: 525.86 ms
May 16, 02:19:10 PM: a809c2b7 Duration: 1303.87 ms Memory Usage: 132 MB Init Duration: 526.99 ms
May 16, 02:19:10 PM: b217cbf1 Duration: 1320.01 ms Memory Usage: 134 MB Init Duration: 523.99 ms
May 16, 02:19:12 PM: 52e3a70b Duration: 5634.80 ms Memory Usage: 181 MB
May 16, 02:19:12 PM: b57fdba8 Duration: 5876.66 ms Memory Usage: 175 MB
May 16, 02:19:14 PM: 88aa20ea Duration: 6784.16 ms Memory Usage: 175 MB Init Duration: 579.52 ms
May 16, 02:19:14 PM: ec94fd57 Duration: 6740.58 ms Memory Usage: 173 MB Init Duration: 527.85 ms
May 16, 02:19:23 PM: d3303f4a INFO [GET] /posts/test-7/ (ODB TTL=60)
May 16, 02:19:23 PM: d3303f4a Duration: 28.18 ms Memory Usage: 173 MB
May 16, 02:19:24 PM: bdd3e04c INFO [GET] /posts/page/2/ (ODB TTL=60)
May 16, 02:19:26 PM: 773f14bf INFO [GET] /posts/page/2/ (ODB TTL=60)
May 16, 02:19:29 PM: bdd3e04c Duration: 4833.52 ms Memory Usage: 173 MB
May 16, 02:19:31 PM: 773f14bf Duration: 4824.05 ms Memory Usage: 175 MB
May 16, 02:19:36 PM: f55b9ef7 INFO [GET] /_next/data/st-TkfJeANHpBLi-Jk9CQ/posts/eum-harum-impedit-placeat.json (ODB TTL=60)
May 16, 02:19:36 PM: 4ae79612 INFO [GET] /_next/data/st-TkfJeANHpBLi-Jk9CQ/posts/quod-nesciunt-ipsa-alias-consequatur-sint-magnam.json (ODB TTL=60)
May 16, 02:19:40 PM: 4ae79612 Duration: 4180.25 ms Memory Usage: 175 MB
May 16, 02:19:41 PM: f55b9ef7 Duration: 4908.32 ms Memory Usage: 173 MB
Please find part of the deploy log as below:
2:17:12 PM: Netlify Build
2:17:12 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
2:17:12 PM: β
2:17:12 PM: β― Version
2:17:12 PM: @netlify/build 29.11.4
2:17:12 PM: β
2:17:12 PM: β― Flags
2:17:12 PM: baseRelDir: true
2:17:12 PM: buildId: 646303b029fd050007afe962
2:17:12 PM: deployId: 646303b029fd050007afe964
2:17:12 PM: β
2:17:12 PM: β― Current directory
2:17:12 PM: /opt/build/repo
2:17:12 PM: β
2:17:12 PM: β― Config file
2:17:12 PM: /opt/build/repo/netlify.toml
2:17:12 PM: β
2:17:12 PM: β― Context
2:17:12 PM: production
2:17:12 PM: β
2:17:12 PM: β― Using Next.js Runtime - v4.37.0
2:17:13 PM: β
2:17:13 PM: @netlify/plugin-nextjs (onPreBuild event)
2:17:13 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
2:17:13 PM: β
2:17:13 PM: Next.js cache restored.
2:17:13 PM: Netlify configuration property βbuild.environment.NEXT_PRIVATE_TARGETβ value changed.
2:17:13 PM: β
2:17:13 PM: (@netlify/plugin-nextjs onPreBuild completed in 94ms)
2:17:13 PM: β
2:17:13 PM: build.command from netlify.toml
2:17:13 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
2:17:13 PM: β
2:17:13 PM: $ yarn build
2:17:14 PM: yarn run v1.22.19
2:17:14 PM: $ next build
2:17:14 PM: info - Linting and checking validity of typesβ¦
2:17:16 PM: info - Creating an optimized production buildβ¦
2:17:23 PM: Successfully created: wp-search.json
2:17:24 PM: Successfully created: sitemap.xml
2:17:24 PM: Successfully created: feed.xml
2:17:26 PM: info - Compiled successfully
2:17:26 PM: info - Collecting page dataβ¦
2:17:30 PM: Warning: You have opted-out of Automatic Static Optimization due to getInitialProps
in pages/_app
. This does not opt-out pages with getStaticProps
2:17:30 PM: Read more: opt-out-auto-static-optimization | Next.js
2:17:30 PM: info - Generating static pages (0/20)
2:17:39 PM: info - Generating static pages (5/20)
2:17:44 PM: info - Generating static pages (10/20)
2:17:58 PM: info - Generating static pages (15/20)
2:18:17 PM: info - Generating static pages (20/20)
2:18:17 PM: info - Finalizing page optimizationβ¦
2:18:17 PM: Route (pages) Size First Load JS
2:18:17 PM: β β / (ISR: 10 Seconds) (9372 ms) 2.92 kB 159 kB
2:18:17 PM: β β css/cbd67ed643337d83.css 2.06 kB
2:18:17 PM: β /_app 0 B 144 kB
2:18:17 PM: β β /[slugParent]/[[β¦slugChild]] (ISR: 10 Seconds) (46540 ms) 2.3 kB 158 kB
2:18:17 PM: β β css/a0c819f8076c8483.css 1.74 kB
2:18:17 PM: β β /404-2 (8749 ms)
2:18:17 PM: β β /sample-page (4969 ms)
2:18:17 PM: β β /odio-ut-earum-ea-qui (4945 ms)
2:18:17 PM: β β /corrupti-unde-similique-reprehenderit-qui-dolores-aut (4943 ms)
2:18:17 PM: β β /consequuntur-fugiat-qui-sed-est-cum (4806 ms)
2:18:17 PM: β β /animi-est-similique-voluptatem-esse-molestiae (4726 ms)
2:18:17 PM: β β /nobis-aperiam-similique-voluptas-ipsum-at-explicabo (4562 ms)
2:18:17 PM: β β [+2 more paths] (avg 4420 ms)
2:18:17 PM: β β /404 (ISR: 10 Seconds) (7066 ms) 576 B 156 kB
2:18:17 PM: β β /500 (ISR: 10 Seconds) (7297 ms) 625 B 156 kB
2:18:17 PM: β β /authors/[slug] 720 B 160 kB
2:18:17 PM: β β /categories (ISR: 10 Seconds) (7736 ms) 1.59 kB 157 kB
2:18:17 PM: β β css/22fc0ef3453ac7c2.css 1.53 kB
2:18:17 PM: β β /categories/[slug] 655 B 160 kB
2:18:17 PM: β β /posts (ISR: 10 Seconds) (8678 ms) 370 B 159 kB
2:18:17 PM: β β /posts/[slug] (ISR: 10 Seconds) (27748 ms) 2.8 kB 158 kB
2:18:17 PM: β β css/dfc03380a3a32ca9.css 1.9 kB
2:18:17 PM: β β /posts/test-7 (8796 ms)
2:18:17 PM: β β /posts/test-new (4803 ms)
2:18:17 PM: β β /posts/test6 (4769 ms)
2:18:17 PM: β β /posts/dolor-ut-vero-totam-cumque-at (4704 ms)
2:18:17 PM: β β /posts/test (4676 ms)
2:18:17 PM: β β /posts/page/[page] 399 B 159 kB
2:18:17 PM: β β /search (ISR: 10 Seconds) (7184 ms) 529 B 160 kB
2:18:17 PM: + First Load JS shared by all 146 kB
2:18:17 PM: β chunks/framework-ac88a2a245aea9ab.js 45.2 kB
2:18:17 PM: β chunks/main-eec79ee3e0bbd536.js 26.9 kB
2:18:17 PM: β chunks/pages/_app-0c1405404f757bf4.js 71.2 kB
2:18:17 PM: β chunks/webpack-59c5c889f52620d6.js 819 B
2:18:17 PM: β css/a2e32438162febfb.css 2.2 kB
2:18:17 PM: β (SSG) automatically generated as static HTML + JSON (uses getStaticProps)
2:18:17 PM: (ISR) incremental static regeneration (uses revalidate in getStaticProps)
2:18:17 PM: Done in 63.80s.
2:18:18 PM: β
2:18:18 PM: (build.command completed in 1m 4s)
2:18:18 PM: β
2:18:18 PM: @netlify/plugin-nextjs (onBuild event)
2:18:18 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
2:18:18 PM: β
2:18:18 PM: Patching /opt/build/repo/node_modules/.pnpm/next@13.4.0_txdvpvppf2ilsh27xadmwrzlmm/node_modules/next/dist/server/base-server.js
2:18:18 PM: Done
2:18:18 PM: Patching /opt/build/repo/node_modules/.pnpm/next@13.4.0_txdvpvppf2ilsh27xadmwrzlmm/node_modules/next/dist/server/next-server.js
2:18:18 PM: Done
2:18:18 PM: Moving static page files to serve from CDNβ¦
2:18:18 PM: Moved 0 files
2:18:18 PM: The following routes use βrevalidateβ values of under 60 seconds, which is not supported.
2:18:18 PM: They will use a revalidate time of 60 seconds instead.
2:18:18 PM: βββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ¬βββββββββββββ
2:18:18 PM: β (index) β Route β Revalidate β
2:18:18 PM: βββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββΌβββββββββββββ€
2:18:18 PM: β 0 β β/searchβ β 10 β
2:18:18 PM: β 1 β β/postsβ β 10 β
2:18:18 PM: β 2 β β/404β β 10 β
2:18:18 PM: β 3 β β/500β β 10 β
2:18:18 PM: β 4 β β/categoriesβ β 10 β
2:18:18 PM: β 5 β β/β β 10 β
2:18:18 PM: β 6 β β/posts/test-7β β 10 β
2:18:18 PM: β 7 β β/posts/test6β β 10 β
2:18:18 PM: β 8 β β/posts/testβ β 10 β
2:18:18 PM: β 9 β β/posts/test-newβ β 10 β
2:18:18 PM: β 10 β β/posts/dolor-ut-vero-totam-cumque-atβ β 10 β
2:18:18 PM: β 11 β β/404-2β β 10 β
2:18:18 PM: β 12 β β/sample-pageβ β 10 β
2:18:18 PM: β 13 β β/odio-ut-earum-ea-quiβ β 10 β
2:18:18 PM: β 14 β β/corrupti-unde-similique-reprehenderit-qui-dolores-autβ β 10 β
2:18:18 PM: β 15 β β/consequuntur-fugiat-qui-sed-est-cumβ β 10 β
2:18:18 PM: β 16 β β/animi-est-similique-voluptatem-esse-molestiaeβ β 10 β
2:18:18 PM: β 17 β β/nobis-aperiam-similique-voluptas-ipsum-at-explicaboβ β 10 β
2:18:18 PM: β 18 β β/ab-quasi-omnis-distinctio-porro-sedβ β 10 β
2:18:18 PM: β 19 β β/quia-quo-rerum-voluptas-eius-culpaβ β 10 β
2:18:18 PM: βββββββββββ΄βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ΄βββββββββββββ
2:18:18 PM: You are not using Netlify Edge Functions for image format detection. Set env var βNEXT_FORCE_EDGE_IMAGES=trueβ to enable.