Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Route handler always returns X-Vercel-Cache: STALE #65814

Open
joostmeijles opened this issue May 15, 2024 · 0 comments
Open

Route handler always returns X-Vercel-Cache: STALE #65814

joostmeijles opened this issue May 15, 2024 · 0 comments
Labels
bug Issue was opened via the bug report template. Pages Router Related to Pages Router.

Comments

@joostmeijles
Copy link

joostmeijles commented May 15, 2024

Link to the code that reproduces this issue

https://github.com/joostmeijles/route-handler-stale/tree/main

Route handler example: https://github.com/joostmeijles/route-handler-stale/blob/main/app/items/%5Bslug%5D/route.ts

To Reproduce

  1. Start the application in production mode
  2. Visit http://localhost:3000/items/a
  3. Inspect the response headers and verify that first visit has x-nextjs-cache: MISS
  4. Visit http://localhost:3000/items/a
  5. Inspect the response headers and verify that first visit has x-nextjs-cache: HIT
  6. Deploy to Vercel
  7. Visit https://routehandler-stale.vercel.app/items/a
  8. Inspect the response headers and verify that it has always X-Vercel-Cache: STALE

Current vs. Expected behavior

Currently always X-Vercel-Cache: STALE is returned.

Expected is X-Vercel-Cache: MISS on first visit and X-Vercel-Cache: HIT for subsequent visits.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 22.2.0: Fri Nov 11 02:04:44 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T8103
  Available memory (MB): 8192
  Available CPU cores: 8
Binaries:
  Node: 20.12.2
  npm: 10.5.0
  Yarn: N/A
  pnpm: 8.15.7
Relevant Packages:
  next: 14.3.0-canary.63 // Latest available version is detected (14.3.0-canary.63).
  eslint-config-next: N/A
  react: 19.0.0-beta-4508873393-20240430
  react-dom: 19.0.0-beta-4508873393-20240430
  typescript: 5.1.3
Next.js Config:
  output: N/A

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

App Router

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

Vercel (Deployed)

Additional context

No response

@joostmeijles joostmeijles added the bug Issue was opened via the bug report template. label May 15, 2024
@github-actions github-actions bot added the Pages Router Related to Pages Router. label May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. Pages Router Related to Pages Router.
Projects
None yet
Development

No branches or pull requests

1 participant