Caching reduces network requests and improves performance.
Browser cache: HTTP cache headers (Cache-Control, ETag). Works for static resources.
In-memory cache: Store responses in JavaScript. Fast but lost on page refresh.
IndexedDB: Persistent browser storage. Good for offline support.
Cache invalidation strategies:
- Time-based: Refresh after N seconds
- Stale-while-revalidate: Show cached, fetch fresh in background
- Manual invalidation: Clear on specific actions
Interview tip: Discuss cache lifetime and invalidation strategy, not just "we'll cache it."