Skip to content

Result cache: size the process-memory LRU with RESULT_CACHE_MB - #80

Merged
alisman merged 1 commit into
masterfrom
session/result-cache-size
Oct 27, 2026
Merged

alisman merged 1 commit into
masterfrom
session/result-cache-size

Conversation

@alisman

@alisman alisman commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Off Vercel, 'use cache: remote' falls back to Next's in-process LRU, whose size is cacheMaxMemorySize (Next's default: 50 MB). This PR lets a deployment set that size with RESULT_CACHE_MB.

  • next.config.mjs: cacheMaxMemorySize is RESULT_CACHE_MB MB. It falls back to 50 when the variable is unset, empty, 0 or not a number, so current deployments behave as before. RESULT_CACHE=off is still the way to turn the cache off.
  • docs/ENVIRONMENT.md and CLAUDE.md (invariant 11) document the variable.

Why: the in-cluster deployment (cbioportal-prod EKS, 1 replica, 2 Gi limit) runs next start, which reads next.config.mjs at 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.mjs passes. I checked the size expression for unset, 256, abc and 0 (50, 256, 50 and 50 MB). I did not run scripts/gate.sh locally.

🤖 Generated with Claude Code

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>
@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cbiolab-genie Ready Ready Preview Oct 27, 2026 1:37am UTC
cohort-lab Ready Ready Preview Oct 27, 2026 1:37am UTC

Request Review

@alisman
alisman merged commit 1cfeb23 into master Oct 27, 2026
10 checks passed
@alisman
alisman deleted the session/result-cache-size branch October 27, 2026 07:53

This branch was successfully deployed

1 active deployment
Preview – cohort-lab — 37d36591 Deployed Oct 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant