KPI Cache Layer
Component Detail
Infrastructure
low complexity
backend
0
Dependencies
0
Dependents
0
Entities
0
Integrations
Description
ISR and stale-while-revalidate caching configuration for KPI API routes in Next.js. Manages short-lived cache headers and revalidation intervals to balance data freshness with server load.
kpi-cache-layer
Responsibilities
- Configure Next.js ISR revalidation intervals for KPI API routes
- Set Cache-Control headers for stale-while-revalidate behavior
- Invalidate cache on relevant data mutations (new activity, approval update)
Interfaces
withKpiCache(handler: NextApiHandler, ttl: number): NextApiHandler
invalidateKpiCache(organizationId: string): Promise<void>