collectionCache<T>(fetchAll: () => Promise<T[]>,ttlMs: number,now?: () => number,): CollectionCache<T>
Create an in-memory collection cache with TTL. Loads all items via fetchAll on first access or after invalidation/expiry, then serves from memory until the TTL expires or invalidate() is called. Accepts an optional clock function for testing.