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
Add docs for x-nextjs-cache header #36023
Conversation
Co-authored-by: Steven <steven@ceriously.com>
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.
Thanks!
The cache status of an image can be determined by reading the value of the `x-nextjs-cache` response header. The possible values are the following: | ||
|
||
- `MISS` - the path is not in the cache (occurs at most once, on the first visit) | ||
- `STALE` - the path is in the cache but exceeded the revalidate time so it will be updated in the background |
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.
I'm not understanding the revalidate time here as it relates to images.
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.
Images can also revalidate: https://nextjs.org/docs/api-reference/next/image#caching-behavior
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.
It is definitely not clear based on reading this - should we add links? Examples?
This adds documentation for the `x-nextjs-cache` header which is now exposed for ISR pages and image optimization requests to help signal the cache state. ## Documentation / Examples - [x] Make sure the linting passes by running `yarn lint` Co-authored-by: Steven <steven@ceriously.com>
This adds documentation for the
x-nextjs-cache
header which is now exposed for ISR pages and image optimization requests to help signal the cache state.Documentation / Examples
yarn lint