Spec: PF-51 Caching Layer & Strategy
Purpose
Centralized in-memory cache for query results, configuration, and reference data. All keys are tenant-scoped:org-{orgId}:{namespace}:{key}.
Public API
Key format
- Full key:
org-{organizationId}:{namespace}:{key}. - Organization ID is required; omit only when using helpers that inject it (e.g. useCachedQuery uses current org from context).
- Missing org throws: “Cache requires organization context”.
Usage
Security
- No PHI/PII in cache keys or values per policy.
- Tenant isolation enforced by key format and org validation.
- Cache is cleared on sign-out (wired in ResponsiveNav).
- User cache is invalidated on role assignment changes (wired in PermissionService).