Repository navigation
docs: cacheMaxMemorySize: 0 is optional, not a multi-instance requirement - #38
Merged
Merged
Conversation
…ment With a custom cacheHandler, Next keeps no in-memory ISR cache of its own: the value is passed to the handler's constructor (incremental-cache/index.js) and this handler never reads it. It only sizes Next's built-in 'use cache' store (use-cache/handlers.js initializeCacheHandlers), which cacheHandlers.default replaces. README, AGENTS.md, the skill, setup.md and the init output said it was required for multi-instance correctness; they now say it is optional and why. The troubleshooting row that listed it as a cause of cross-instance misses drops that cause.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
cacheMaxMemorySize: 0was described as "required for multi-instance correctness" in the README checklist and quick start,AGENTS.md, the agent skill,setup-instructions/setup.mdand theinitCLI output. It is optional. The wording now says so and explains what the option actually does.Why (Next.js 16.2.4 source)
server/lib/incremental-cache/index.js100–110: with a customcacheHandler,maxMemoryCacheSizeis only forwarded to the handler's constructor. Next keeps no in-memory ISR cache of its own in that case; the LRU lives insideFileSystemCache(file-system-cache.js29–34), which is not used when a custom handler is configured.ctx.maxMemoryCacheSize(no reference insrc/).'use cache'store:server/use-cache/handlers.jsinitializeCacheHandlers(cacheMaxMemorySize)→createDefaultCacheHandler(maxSize). ConfiguringcacheHandlers.default(the recommended wiring) replaces it (next-server.js581–590).So keeping
0is harmless and matches Next's self-hosting docs, but it was never what made multi-instance reads consistent. The troubleshooting row that listed "cacheMaxMemorySizenot 0" as a cause of cross-instance misses now lists only namespace/prefix mismatch.Changes
AGENTS.mdhard rule 2skills/nextjs-redis-cache/SKILL.md: wiring comment, checklist item, troubleshooting rowsetup-instructions/setup.mdcommentsrc/cli/index.ts:initoutput comment (tests/unit/cli.test.tsstill passes; it checks the key, not the comment)No runtime behavior changes.