-
Notifications
You must be signed in to change notification settings - Fork 29.6k
docs: cache life rework #85224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: canary
Are you sure you want to change the base?
docs: cache life rework #85224
Conversation
CodSpeed Performance ReportMerging #85224 will not alter performanceComparing Summary
Footnotes
|
Cache profiles control caching behavior through three timing properties: | ||
|
||
However, we recommend always adding a cache profile when using the `use cache` directive to explicitly define caching behavior. | ||
- **`stale`**: How long the client can use cached data without checking the server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets link to the sections below from each of these
1. Serves the cached version immediately (if available) | ||
2. Regenerates content in the background | ||
3. Updates the cache with fresh content | ||
- Similar to Incremental Static Regeneration (ISR) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link to ISR docs
|
||
**The client enforces a minimum stale time of 30 seconds**: This ensures that prefetched data remains usable long enough for users to click on links after they've been prefetched. Without this minimum, very short stale times would cause prefetched data to expire before it could be used, making prefetching ineffective. | ||
- After this period with no traffic, the next request regenerates content synchronously | ||
- Must be longer than `revalidate` when both are specified |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do i get an error if its not? What happens if i do this wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some small nits, overall this is well explained!
No description provided.