vercel/next.js

Vercel Deployment: Cache Revalidation Failure in Next.js

gentritbiba opened this issue · 0 comments

Link to the code that reproduces this issue

https://github.com/gentritbiba/caching-test

To Reproduce

  1. Build and run the application locally.

    • Verify that the application builds successfully.
    • Start the development server.
  2. Test local cache revalidation

    • Click the "Refresh Time" button.
    • Verify that the cache is properly revalidated.
  3. Deploy the application to Vercel

    • Push code to your repository.
    • Trigger a Vercel deployment.
  4. Test cache revalidation in production.

    • Click the "Refresh Time" button.
    • Notice how the cache does not revalidate.

Current vs. Expected behavior

##Current
It works locally, it doesn't on Vercel deployment.

##Expected
Should work on Vercel just as it work locally.

Provide environment information

Environment Details

Platform: Vercel
Framework: Next.js 15.1.1-canary.6
Deployment Type: Serverless
Caching Method: unstable_cacheTag() with "use cache"

Local Detals:
Operating System:
  Platform: linux
  Arch: x64
  Version: #52-Ubuntu SMP PREEMPT_DYNAMIC Thu Dec  5 13:09:44 UTC 2024
  Available memory (MB): 31230
  Available CPU cores: 16
Binaries:
  Node: 22.10.0
  npm: 10.9.0
  Yarn: N/A
  pnpm: 9.15.0
Relevant Packages:
  next: 15.1.1-canary.6 // There is a newer canary version (15.1.1-canary.13) available, please upgrade! 
  eslint-config-next: 15.1.1-canary.6
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.7.2
Next.js Config:
    dynamicIO: true,
    ppr: 'incremental',
    reactCompiler: true,
    authInterrupts: true,

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

dynamicIO

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

Vercel (Deployed)

Additional context

Overview

The issue involves unexpected behavior with cache revalidation when deploying a Next.js application using the new useCache method with cacheTag() on Vercel's production environment.

Detailed Problem Description

Cache revalidation fails specifically in the Vercel production deployment, while working correctly in local and Docker container environments. This suggests a potential platform-specific compatibility issue with Next.js's experimental caching API.

Here is an example deployment: https://caching-test-orcin.vercel.app/