Skip to content

revalidateTag not using stale-while-revalidate #85780

@matthewca

Description

@matthewca

Link to the code that reproduces this issue

https://github.com/matthewca/revalidatetag-swr-issue

To Reproduce

  1. npm run build
  2. npm run start
  3. open localhost:3000/en/demo
  4. POST to localhost:3000/api/demo/clear
  5. refresh localhost:3000/en/demo

Current vs. Expected behavior

After revalidating the tag and refreshing the demo page, I expected to see the stale data instantly.

Instead, the page seems to wait until the new data is received before displaying the old stale data in the component. Refreshing once more reveals the new data.

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #35~22.04.1-Ubuntu SMP Mon May 26 18:08:30 UTC 2025
  Available memory (MB): 7945
  Available CPU cores: 2
Binaries:
  Node: 22.17.0
  npm: 9.8.1
  Yarn: 1.22.22
  pnpm: 10.13.1
Relevant Packages:
  next: 16.0.1 // Latest available version is detected (16.0.1).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

cacheComponents

Which stage(s) are affected? (Select all that apply)

next build (local)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions