plan/react-rewrite #1
@@ -386,7 +386,7 @@ No Axios. No TanStack Query. No SWR.
|
||||
Custom ~80-line cache keyed by full URL. TTL: 30s for search results, 5m for static reference data (airports, cities). Replaces the Angular `CacheService` directly.
|
||||
|
||||
**Shared server-side LRU cache (per-VM).**
|
||||
`@isaacs/ttlcache`, in-memory, ~100MB cap. Keyed by `(endpoint, queryParams, locale)`. TTL: 30s for live data, 5m for static data. Per-VM, not shared across VMs — no Redis in the frontend tier (adds failure modes).
|
||||
`lru-cache@^10`, in-memory, ~100MB byte cap via `maxSize` + `sizeCalculation` (default sizer: `JSON.stringify(value).length`; callers may pass a pre-computed size hint from the response `content-length` to avoid O(n) sizing on write). Keyed by `(endpoint, queryParams, locale)`. TTL: 30s for live data, 5m for static data. Per-VM, not shared across VMs — no Redis in the frontend tier (adds failure modes). (`@isaacs/ttlcache` was considered but lacks byte-based caps — `lru-cache@^10`, also maintained by isaacs, is the correct primitive for a 100MB hard limit.)
|
||||
|
||||
### 4.3 SSR → client data handoff
|
||||
|
||||
@@ -744,7 +744,7 @@ Cross-Origin-Resource-Policy: cross-origin
|
||||
|
||||
**Mechanisms:**
|
||||
|
||||
1. **Loader-level caching** — per-request dedup + per-VM LRU (`@isaacs/ttlcache`, 100MB cap, 30s TTL live / 5m TTL static).
|
||||
1. **Loader-level caching** — per-request dedup + per-VM LRU (`lru-cache@^10` with `maxSize` byte cap, 100MB cap, 30s TTL live / 5m TTL static).
|
||||
2. **HTTP cache headers by route type:**
|
||||
|
||||
| Route type | `Cache-Control` |
|
||||
|
||||
Reference in New Issue
Block a user