Link to the code that reproduces this issue
https://github.com/sidletski/next-cache-issues
To Reproduce
- Clone the example project
- Install dependencies and run the development server (:3000 port)
- Navigate to the main page, which displays a list of users fetched from the internal API
- Click on the "Edit user" button for a specific user to go to the edit page
- Make changes to the user's information and submit the form
- Click the "Go back" button to return to the main page
- Observe that the user list on the main page is not updated with the new data
- Click the "Edit user" button again for the same user (or use browser back button)
- Notice that the edit form displays the old, unedited data
- Refresh the page manually (e.g., F5, Cmd+R or browser refresh button)
- Observe that only after a force reload, the updated data appears
Current vs. Expected behavior
After editing a user and navigating back using the "Go back" button (which uses next/link) or the browser's back button, the main page shows stale data, but I want the list to reflect the updated data
unstable_ functions from the next/cache package doesn't help :(
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 23.4.0: Fri Mar 15 00:10:42 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6000
Available memory (MB): 16384
Available CPU cores: 10
Binaries:
Node: 18.17.0
npm: 9.6.7
Yarn: 1.22.19
pnpm: 8.15.7
Relevant Packages:
next: 14.2.9 // Latest available version is detected (14.2.9).
eslint-config-next: 14.2.9
react: 18.3.1
react-dom: 18.3.1
typescript: 5.6.2
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Navigation, Pages Router
Which stage(s) are affected? (Select all that apply)
next dev (local), next start (local), Vercel (Deployed), Other (Deployed)
Additional context
No response
Link to the code that reproduces this issue
https://github.com/sidletski/next-cache-issues
To Reproduce
Current vs. Expected behavior
After editing a user and navigating back using the "Go back" button (which uses next/link) or the browser's back button, the main page shows stale data, but I want the list to reflect the updated data
unstable_functions from thenext/cachepackage doesn't help :(Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.4.0: Fri Mar 15 00:10:42 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6000 Available memory (MB): 16384 Available CPU cores: 10 Binaries: Node: 18.17.0 npm: 9.6.7 Yarn: 1.22.19 pnpm: 8.15.7 Relevant Packages: next: 14.2.9 // Latest available version is detected (14.2.9). eslint-config-next: 14.2.9 react: 18.3.1 react-dom: 18.3.1 typescript: 5.6.2 Next.js Config: output: N/AWhich area(s) are affected? (Select all that apply)
Navigation, Pages Router
Which stage(s) are affected? (Select all that apply)
next dev (local), next start (local), Vercel (Deployed), Other (Deployed)
Additional context
No response