Summary of What Needs to be Done:
The metrics-cache.ts uses localeCompare for sorting cache keys. localeCompare is locale-aware and can produce different sort orders depending on the environment, causing cache misses across different server instances.
Changes that Need to be Made:
- File: src/lib/metrics-cache.ts (lines 59-62)
- Replace localeCompare with simple string comparison: a < b ? -1 : a > b ? 1 : 0
Impact that it would Provide:
- Ensures consistent cache keys across all server instances
- Prevents cache misses due to locale differences
Summary of What Needs to be Done:
The metrics-cache.ts uses localeCompare for sorting cache keys. localeCompare is locale-aware and can produce different sort orders depending on the environment, causing cache misses across different server instances.
Changes that Need to be Made:
Impact that it would Provide: