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

[next@15] use-cache not persisted #2694

Open
pieh opened this issue Oct 23, 2024 · 0 comments
Open

[next@15] use-cache not persisted #2694

pieh opened this issue Oct 23, 2024 · 0 comments
Labels
Next.js e2e test failure Errors identified through the Next.js repo e2e tests Next.js

Comments

@pieh
Copy link
Contributor

pieh commented Oct 23, 2024

use-cache uses different CacheHandler than full page cache, fetch-cache etc - by default it uses https://github.com/vercel/next.js/blob/canary/packages/next/src/server/lib/cache-handlers/default.ts but this can be configured with experimental.cacheHandlers.default (?) next.config.js option to use custom implementation.

Default implementation relies on in-memory cache so for some cases it might seem like it is working - but this cache lives only as long as lambda instance and if lambda instances are scaled they all each have their own ~local caches.

This is different than using unstable_cache which seems to rely on fetch-cache instead which is actually properly persisted right now.

Do note that use-cache is only allowed when dynamicIO experimental feature is enabled - and that can't even be enabled with stable next@15 versions (at least at the time of creating this issue - so not possible on 15.0.0 and 15.0.1)

Data

The following is parsed automatically by the Next.js repo e2e test report generator.

test: test/e2e/app-dir/use-cache/use-cache.test.ts, test/e2e/app-dir/use-cache-route-handler-only/use-cache-route-handler-only.test.ts
reason: use-cache not persisted

@pieh pieh added the Next.js e2e test failure Errors identified through the Next.js repo e2e tests label Oct 23, 2024
@linear linear bot added the Next.js label Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Next.js e2e test failure Errors identified through the Next.js repo e2e tests Next.js
Projects
None yet
Development

No branches or pull requests

1 participant