Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ changing first. The parts, and the one place each rule lives:
- **`RESULT_CACHE=off` turns it off.** `throughCache` then runs the direct call on every
request, so a server answers everything cold — for measuring what a first reader waits for.
Without a cache handler configured (anywhere but Vercel), the cache is the Node process's own
50 MB LRU (`cacheMaxMemorySize`): lost on restart, and not shared between replicas.
LRU (`cacheMaxMemorySize`, 50 MB unless `RESULT_CACHE_MB` says otherwise): lost on restart,
and not shared between replicas.
- **Arguments are the key.** A cached function takes only serializable arguments and computes
everything else itself; a function passed in cannot be called. Anything that changes the
answer must be an argument.
Expand Down
1 change: 1 addition & 0 deletions docs/ENVIRONMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ see the security notes below.
| var | default | meaning |
|---|---|---|
| `RESULT_CACHE` | on | `off`: answer every request directly, bypassing the result cache, to measure what a first reader waits for |
| `RESULT_CACHE_MB` | `50` | the result cache's size in MB where it is process memory (anywhere but Vercel); read at server start |
| `CLICKHOUSE_MAX_INFLIGHT` | `8` | ClickHouse queries in flight at once per process; the rest queue (`docs/PERFORMANCE.md`) |
| `EXPLORE_COHORT_EXTERNAL_LIMIT` | `50000` | the most patient ids Explore ships to ClickHouse for one draft cohort |
| `ONCOPRINT_CLUSTER_LIMIT` | `4000` | the most columns an oncoprint clusters (`cluster:<profile>` sort) |
Expand Down
3 changes: 3 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ const nextConfig = (phase) => ({
distDir: process.env.NEXT_DIST_DIR || ".next",
// `'use cache: remote'` (lib/next-cache.ts) needs Cache Components
cacheComponents: true,
// Off Vercel that cache is this process-memory LRU; `next start` reads it at startup, so a
// deployment sizes it without a rebuild
cacheMaxMemorySize: (Number(process.env.RESULT_CACHE_MB) || 50) * 1024 * 1024,
// hosts besides localhost that may load `next dev`'s scripts and HMR socket (e.g. a tailnet
// proxy in front of a dev server); comma-separated, dev only
allowedDevOrigins: (process.env.ALLOWED_DEV_ORIGINS || "").split(",").map((h) => h.trim()).filter(Boolean),
Expand Down
Loading