Repository navigation
Result cache: size the process-memory LRU with RESULT_CACHE_MB - #80
Merged
Merged
Conversation
Off Vercel, 'use cache: remote' falls back to Next's in-memory LRU, sized by cacheMaxMemorySize (50 MB by default). A large oncoprint contract is ~2.5 MB packed, so the default holds only a handful. next.config.mjs now takes the size from RESULT_CACHE_MB, defaulting to 50; `next start` reads it at server start, so a deployment can resize the cache without a rebuild. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Off Vercel,
'use cache: remote'falls back to Next's in-process LRU, whose size iscacheMaxMemorySize(Next's default: 50 MB). This PR lets a deployment set that size withRESULT_CACHE_MB.next.config.mjs:cacheMaxMemorySizeisRESULT_CACHE_MBMB. It falls back to 50 when the variable is unset, empty,0or not a number, so current deployments behave as before.RESULT_CACHE=offis still the way to turn the cache off.docs/ENVIRONMENT.mdandCLAUDE.md(invariant 11) document the variable.Why: the in-cluster deployment (cbioportal-prod EKS, 1 replica, 2 Gi limit) runs
next start, which readsnext.config.mjsat startup, so the size can be raised from the Kubernetes manifest. A large oncoprint contract is about 2.5 MB packed, so 50 MB holds only a few of them.Testing:
node --check next.config.mjspasses. I checked the size expression for unset,256,abcand0(50, 256, 50 and 50 MB). I did not runscripts/gate.shlocally.🤖 Generated with Claude Code