Incremental Revalidation
Revalidation allows previously generated content to be reused while still allowing it to become fresh periodically or when explicitly invalidated.
Imagine a news homepage that can tolerate content being several seconds or minutes old. Revalidation can provide a useful balance between freshness and performance.
The key architectural question is not simply 'SSR or SSG?' but 'how fresh does this data actually need to be?'
Time-Based Revalidation
const response = await fetch('[https://example.com/api/products](https://example.com/api/products)', {
next: {
revalidate: 60
}
});
const products = await response.json();💡 The fetch configuration expresses that cached data can be revalidated periodically rather than requiring a fresh request every time.
Key Takeaways
- Revalidation is useful when data changes but does not need request-level freshness.
- Choose freshness requirements based on business needs.
- Caching strategy should be part of application architecture.