NextJS revalidate for dynamic routes

Site name: rf-zone.rebelsfunding.com

Hey guys, I have a problem with nextjs revalidate feature for dynamic routes with this file structure /charts/[slug]/page.js
If I have a fetch with revalidate in a normal page it works fine, but here it seems to be ignored.

You can check this deploy
https://64f6ec370680a60008f61267--rf-zone.netlify.app/charts/9021
After reloading it’s fetching again.

Fetch request options:
const requestOptions = {
method: “POST”,
next: { revalidate: 300 },
headers: {
“Content-Type”: “application/x-www-form-urlencoded”,
},
body: formBody,
};

deploy log

10:53:22 AM: Starting post processing
10:53:22 AM: Skipping HTML post processing
10:53:23 AM: Post processing - header rules
10:53:23 AM: Post processing - redirect rules
10:53:23 AM: Post processing done
10:53:24 AM: Section completed: postprocessing
10:53:25 AM: Site is live ✨
10:52:09 AM: build-image version: 8205490ca60064f5c9949f585e9e35b434be95b8 (focal)
10:52:09 AM: buildbot version: eb0b3c03ee1b40888f6883e255e3a141a5a683be
10:52:09 AM: Fetching cached dependencies
10:52:09 AM: Starting to download cache of 212.0MB
10:52:12 AM: Finished downloading cache in 3.021s
10:52:12 AM: Starting to extract cache
10:52:14 AM: Finished extracting cache in 1.892s
10:52:14 AM: Finished fetching cache in 4.97s
10:52:14 AM: Starting to prepare the repo for build
10:52:14 AM: Preparing Git Reference refs/heads/release/compet-1
10:52:16 AM: Starting to install dependencies
10:52:16 AM: Python version set to 3.8
10:52:16 AM: Attempting Ruby version 2.7.2, read from environment
10:52:17 AM: Using Ruby version 2.7.2
10:52:17 AM: Started restoring cached go cache
10:52:17 AM: Finished restoring cached go cache
10:52:19 AM: go version go1.19.12 linux/amd64
10:52:19 AM: Using PHP version 8.0
10:52:20 AM: Started restoring cached Node.js version
10:52:21 AM: Finished restoring cached Node.js version
10:52:21 AM: v18.17.1 is already installed.
10:52:21 AM: Now using node v18.17.1 (npm v9.6.7)
10:52:21 AM: Enabling Node.js Corepack
10:52:21 AM: Started restoring cached build plugins
10:52:21 AM: Finished restoring cached build plugins
10:52:21 AM: Started restoring cached corepack dependencies
10:52:21 AM: Finished restoring cached corepack dependencies
10:52:21 AM: No npm workspaces detected
10:52:21 AM: Started restoring cached node modules
10:52:21 AM: Finished restoring cached node modules
10:52:21 AM: Installing npm packages using npm version 9.6.7
10:52:22 AM: up to date, audited 316 packages in 569ms
10:52:22 AM: 14 packages are looking for funding
10:52:22 AM:   run `npm fund` for details
10:52:22 AM: found 0 vulnerabilities
10:52:22 AM: npm packages installed
10:52:23 AM: Install dependencies script success
10:52:23 AM: Starting build script
10:52:23 AM: Detected 1 framework(s)
10:52:23 AM: next at version 13.4.6
10:52:23 AM: Section completed: initializing
10:52:25 AM: ​
10:52:25 AM: Netlify Build                                                 
10:52:25 AM: ────────────────────────────────────────────────────────────────
10:52:25 AM: ​
10:52:25 AM: ❯ Version
10:52:25 AM:   @netlify/build 29.20.11
10:52:25 AM: ​
10:52:25 AM: ❯ Flags
10:52:25 AM:   baseRelDir: true
10:52:25 AM:   buildId: 64f6ec370680a60008f61265
10:52:25 AM:   deployId: 64f6ec370680a60008f61267
10:52:25 AM: ​
10:52:25 AM: ❯ Current directory
10:52:25 AM:   /opt/build/repo
10:52:25 AM: ​
10:52:25 AM: ❯ Config file
10:52:25 AM:   No config file was defined: using default values.
10:52:25 AM: ​
10:52:25 AM: ❯ Context
10:52:25 AM:   branch-deploy
10:52:25 AM: ​
10:52:25 AM: ❯ Using Next.js Runtime - v4.40.1
10:52:26 AM: ​
10:52:26 AM: @netlify/plugin-nextjs (onPreBuild event)                     
10:52:26 AM: ────────────────────────────────────────────────────────────────
10:52:26 AM: ​
10:52:26 AM: Next.js cache restored.
10:52:26 AM: Netlify configuration property build.environment.NEXT_PRIVATE_TARGET value changed.
10:52:26 AM: ​
10:52:26 AM: (@netlify/plugin-nextjs onPreBuild completed in 172ms)
10:52:26 AM: ​
10:52:26 AM: Build command from Netlify app                                
10:52:26 AM: ────────────────────────────────────────────────────────────────
10:52:26 AM: ​
10:52:26 AM: $ npm run build
10:52:26 AM: > client-zone-next@0.1.0 build
10:52:26 AM: > next build
10:52:27 AM: - info Creating an optimized production build...
10:52:32 AM: - info Compiled successfully
10:52:32 AM: - info Linting and checking validity of types...
10:52:32 AM: - info Collecting page data...
10:52:34 AM: - info Generating static pages (0/7)
10:52:35 AM: - info Generating static pages (1/7)
10:52:35 AM: - info Generating static pages (3/7)
10:52:35 AM: - info Generating static pages (5/7)
10:52:35 AM: - info Generating static pages (7/7)
10:52:37 AM: - info Finalizing page optimization...
10:52:37 AM: Route (app)                                Size     First Load JS
10:52:37 AM: ┌ ○ /                                      0 B                0 B
10:52:37 AM: ├ λ /api/history                           0 B                0 B
10:52:37 AM: ├ λ /api/personal                          0 B                0 B
10:52:37 AM: ├ λ /charts/[id]                           214 B           311 kB
10:52:37 AM: ├ ○ /favicon.ico                           0 B                0 B
10:52:37 AM: ├ λ /history/[group]                       1.88 kB         327 kB
10:52:37 AM: └ λ /leaderboard                           1.64 kB         327 kB
10:52:37 AM: + First Load JS shared by all              78 kB
10:52:37 AM:   ├ chunks/769-6a9595e3e30c39cb.js         25.3 kB
10:52:37 AM:   ├ chunks/bce60fc1-d2ed350e07f7f94a.js    50.5 kB
10:52:37 AM:   ├ chunks/main-app-e6458dc727967c63.js    221 B
10:52:37 AM:   └ chunks/webpack-0567b6d1860acafe.js     1.94 kB
10:52:37 AM: Route (pages)                              Size     First Load JS
10:52:37 AM: ─ ○ /404                                   184 B          75.2 kB
10:52:37 AM: + First Load JS shared by all              75 kB
10:52:37 AM:   ├ chunks/framework-43665103d101a22d.js   45.1 kB
10:52:37 AM:   ├ chunks/main-3f399622bbc1615d.js        27.8 kB
10:52:37 AM:   ├ chunks/pages/_app-1f2755172264764d.js  198 B
10:52:37 AM:   └ chunks/webpack-0567b6d1860acafe.js     1.94 kB
10:52:37 AM: λ  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
10:52:37 AM: ○  (Static)  automatically rendered as static HTML (uses no initial props)
10:52:37 AM: ​
10:52:37 AM: (build.command completed in 10.5s)
10:52:37 AM: ​
10:52:37 AM: @netlify/plugin-nextjs (onBuild event)                        
10:52:37 AM: ────────────────────────────────────────────────────────────────
10:52:37 AM: ​
10:52:37 AM: Moving static page files to serve from CDN...
10:52:37 AM: Moved 4 files
10:52:37 AM: You are not using Netlify Edge Functions for image format detection. Set env var NEXT_FORCE_EDGE_IMAGES=true to enable.
10:52:37 AM: Netlify configuration property redirects value changed to [
10:52:37 AM:   { from: '/_next/static/*', to: '/static/:splat', status: 200 },
10:52:37 AM:   {
10:52:37 AM:     from: '/_next/image*',
10:52:37 AM:     query: { url: ':url', w: ':width', q: ':quality' },
10:52:37 AM:     to: '/_ipx/w_:width,q_:quality/:url',
10:52:37 AM:     status: 301
10:52:37 AM:   },
10:52:37 AM:   { from: '/_ipx/*', to: '/.netlify/builders/_ipx', status: 200 },
10:52:37 AM:   {
10:52:37 AM:     from: '/api/*',
10:52:37 AM:     to: '/.netlify/functions/___netlify-handler',
10:52:37 AM:     status: 200
10:52:37 AM:   },
10:52:37 AM:   {
10:52:37 AM:     from: '/bronzova.webp',
10:52:37 AM:     to: '/bronzova.webp',
10:52:37 AM:     conditions: { Cookie: [Array] },
10:52:37 AM:     status: 200
10:52:37 AM:   },
10:52:37 AM:   {
10:52:37 AM:     from: '/rf_logo.webp',
10:52:37 AM:     to: '/rf_logo.webp',
10:52:37 AM:     conditions: { Cookie: [Array] },
10:52:37 AM:     status: 200
10:52:37 AM:   },
10:52:37 AM:   {
10:52:37 AM:     from: '/strieborna.webp',
10:52:37 AM:     to: '/strieborna.webp',
10:52:37 AM:     conditions: { Cookie: [Array] },
10:52:37 AM:     status: 200
10:52:37 AM:   },
10:52:37 AM:   {
10:52:37 AM:     from: '/zlata.webp',
10:52:37 AM:     to: '/zlata.webp',
10:52:37 AM:     conditions: { Cookie: [Array] },
10:52:37 AM:     status: 200
10:52:37 AM:   },
10:52:37 AM:   {
10:52:37 AM:     from: '/*',
10:52:37 AM:     to: '/.netlify/functions/___netlify-handler',
10:52:37 AM:     status: 200,
10:52:37 AM:     conditions: { Cookie: [Array] },
10:52:37 AM:     force: true
10:52:37 AM:   },
10:52:37 AM:   {
10:52:37 AM:     from: '/_next/data/6icDTgCHAXRlbvYMQz_cn/leaderboard.json',
10:52:37 AM:     to: '/.netlify/functions/___netlify-handler',
10:52:37 AM:     status: 200,
10:52:37 AM:     force: false
10:52:37 AM:   },
10:52:37 AM:   {
10:52:37 AM:     from: '/leaderboard',
10:52:37 AM:     to: '/.netlify/functions/___netlify-handler',
10:52:37 AM:     status: 200,
10:52:37 AM:     force: false
10:52:37 AM:   },
10:52:37 AM:   {
10:52:37 AM:     from: '/_next/data/6icDTgCHAXRlbvYMQz_cn/charts/:id.json',
10:52:37 AM:     to: '/.netlify/functions/___netlify-handler',
10:52:37 AM:     status: 200,
10:52:37 AM:     force: false
10:52:37 AM:   },
10:52:37 AM:   {
10:52:37 AM:     from: '/charts/:id',
10:52:37 AM:     to: '/.netlify/functions/___netlify-handler',
10:52:37 AM:     status: 200,
10:52:37 AM:     force: false
10:52:37 AM:   },
10:52:37 AM:   {
10:52:37 AM:     from: '/_next/data/6icDTgCHAXRlbvYMQz_cn/history/:group.json',
10:52:37 AM:     to: '/.netlify/functions/___netlify-handler',
10:52:37 AM:     status: 200,
10:52:37 AM:     force: false
10:52:37 AM:   },
10:52:37 AM:   {
10:52:37 AM:     from: '/history/:group',
10:52:37 AM:     to: '/.netlify/functions/___netlify-handler',
10:52:37 AM:     status: 200,
10:52:37 AM:     force: false
10:52:37 AM:   },
10:52:37 AM:   {
10:52:37 AM:     from: '/*',
10:52:37 AM:     to: '/.netlify/functions/___netlify-handler',
10:52:37 AM:     status: 200
10:52:37 AM:   }
10:52:37 AM: ].
10:52:37 AM: ​
10:52:37 AM: (@netlify/plugin-nextjs onBuild completed in 73ms)
10:52:37 AM: ​
10:52:37 AM: Functions bundling                                            
10:52:37 AM: ────────────────────────────────────────────────────────────────
10:52:37 AM: ​
10:52:37 AM: Packaging Functions from .netlify/functions-internal directory:
10:52:37 AM:  - ___netlify-handler/___netlify-handler.js
10:52:37 AM:  - ___netlify-odb-handler/___netlify-odb-handler.js
10:52:37 AM:  - _ipx/_ipx.js
10:52:37 AM: ​
10:53:13 AM: ​
10:53:13 AM: (Functions bundling completed in 36.2s)
10:53:13 AM: ​
10:53:13 AM: Edge Functions bundling                                       
10:53:13 AM: ────────────────────────────────────────────────────────────────
10:53:13 AM: ​
10:53:13 AM: Packaging Edge Functions from .netlify/edge-functions directory:
10:53:13 AM:  - rsc-data
10:53:14 AM: ​
10:53:14 AM: (Edge Functions bundling completed in 498ms)
10:53:14 AM: ​
10:53:14 AM: @netlify/plugin-nextjs (onPostBuild event)                    
10:53:14 AM: ────────────────────────────────────────────────────────────────
10:53:14 AM: ​
10:53:14 AM: Next.js cache saved.
10:53:14 AM: 🧪 Thank you for testing appDir support on Netlify. For known issues and to give feedback, visit https://ntl.fyi/next-13-feedback
10:53:14 AM: ​
10:53:14 AM: (@netlify/plugin-nextjs onPostBuild completed in 232ms)
10:53:14 AM: ​
10:53:14 AM: Deploy site                                                   
10:53:14 AM: ────────────────────────────────────────────────────────────────
10:53:14 AM: ​
10:53:14 AM: Starting to deploy site from '.next'
10:53:14 AM: Calculating files to upload
10:53:14 AM: 11 new files to upload
10:53:14 AM: 2 new functions to upload
10:53:22 AM: Section completed: deploying
10:53:22 AM: Site deploy was successfully initiated
10:53:22 AM: ​
10:53:22 AM: (Deploy site completed in 8.3s)
10:53:22 AM: ​
10:53:22 AM: Netlify Build Complete                                        
10:53:22 AM: ────────────────────────────────────────────────────────────────
10:53:22 AM: ​
10:53:22 AM: (Netlify Build completed in 57.4s)
10:53:23 AM: Caching artifacts
10:53:23 AM: Started saving node modules
10:53:23 AM: Finished saving node modules
10:53:23 AM: Started saving build plugins
10:53:23 AM: Finished saving build plugins
10:53:23 AM: Started saving corepack cache
10:53:23 AM: Finished saving corepack cache
10:53:23 AM: Started saving pip cache
10:53:23 AM: Finished saving pip cache
10:53:23 AM: Started saving emacs cask dependencies
10:53:23 AM: Finished saving emacs cask dependencies
10:53:23 AM: Started saving maven dependencies
10:53:23 AM: Finished saving maven dependencies
10:53:23 AM: Started saving boot dependencies
10:53:23 AM: Finished saving boot dependencies
10:53:23 AM: Started saving rust rustup cache
10:53:23 AM: Finished saving rust rustup cache
10:53:23 AM: Started saving go dependencies
10:53:23 AM: Finished saving go dependencies
10:53:23 AM: Build script success
10:53:23 AM: Section completed: building
10:53:24 AM: Uploading Cache of size 212.6MB
10:53:26 AM: Section completed: cleanup
10:53:26 AM: Finished processing build request in 1m17.102s

What are you trying to do? Are you trying to revalidate your URL by making a request? If yes, that’s not possible.

I was trying to revalidate a fetch that was inside of dynamic route, so it was a dynamic fetch in a sense.

Is there some documentation for this feature? I haven’t seen anyone use it and based on my ignorance, you can guess, I’ve never used it myself either.

Seems like I misunderstood the function of dynamic routes, so far the revalidation is impossible for fetches of this type