Next.js 14 App Router Caching
The App Router has multiple caching layers: Router Cache (client), Full Route Cache (server), Request Memoization, and Data Cache. Understanding when each layer kicks in is crucial for performance.
A collection of quick learnings, insights, and “aha” moments. Think of this as my digital garden - a space for growing ideas that might not be fully-formed blog posts yet, but are worth sharing.
The App Router has multiple caching layers: Router Cache (client), Full Route Cache (server), Request Memoization, and Data Cache. Understanding when each layer kicks in is crucial for performance.
text-embedding-ada-002 creates 1536-dimensional vectors. You can reduce dimensions using PCA for faster similarity search, but you lose some semantic precision. Trade-off is usually worth it above 10k documents.
Network-first is great for dynamic content with offline fallback. Cache-first is better for static assets. Stale-while-revalidate gives instant response while updating cache in background - perfect for blogs.
Whether you have a project in mind or just want to chat, I'm always open to discussing new opportunities and ideas.