Skip to content

[BUG] Next.js 16.1.0 / Next.js 16.0.10 - revalidateTag with profile "max" / stale-while-revalidate does not work #1058

@grabmateusz

Description

@grabmateusz

Describe the bug

Currently OpenNext Cloudflare Adapter does not support revalidateTag with profile "max" / stale-while-revalidate.
This just does not work - it behaves like regular revalidateTag in Next.js 15, so all the requests that happen after execution of:

revalidateTag('<tag>', 'max')

are time consuming with cache MISS, while they should return stale data immediately and revalidate cache in the background.
Like in the similar issue I've created before ( #1052 ) - this functionality is confirmed to work this way on both self-hosted Next.js application and Next.js application hosted on Vercel.

Changes while comparing to previously reported issue for reference

Steps to reproduce

  1. Checkout branch next-16-d1-next-tag-cache-solution from reproduction repository
  2. Try to build and deploy code as per README
  3. Visit https://<domain>/isr to render ISRed page
  4. Call https://<domain>/api/revalidate-data-cache to revalidate data cache using revalidateTag method
  5. Visit https://<domain>/isr to render ISRed page

Expected behavior

Like on self-hosted Next.js application or in application deployed to Vercel - second visit to https://<domain>/isr should return markup immediately with STALE cache and should revalidate given path in the background, so subsequent requests will have up-to-date cache once it's revalidated.

@opennextjs/cloudflare version

1.14.7

Wrangler version

4.56.0

next info output

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:29 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6000
  Available memory (MB): 32768
  Available CPU cores: 10
Binaries:
  Node: 20.19.2
  npm: 10.8.2
  Yarn: 1.22.21
  pnpm: 10.15.0
Relevant Packages:
  next: 16.1.1 // Latest available version is detected (16.1.1).
  eslint-config-next: 15.4.6
  react: 19.1.4
  react-dom: 19.1.4
  typescript: 5.9.3
Next.js Config:
  output: N/A

Additional context

It might be valuable to link this issue to Next16 support ticket

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions