Skip to content
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

Merged
merged 7 commits into from Apr 8, 2022
Merged

Conversation

ijjk
Copy link
Member

@ijjk ijjk commented Apr 8, 2022

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

  • Make sure the linting passes by running yarn lint

@ijjk ijjk marked this pull request as ready for review April 8, 2022 21:03
docs/api-reference/next/image.md Outdated Show resolved Hide resolved
ijjk and others added 2 commits April 8, 2022 16:25
Co-authored-by: Steven <steven@ceriously.com>
@ijjk ijjk requested a review from styfle April 8, 2022 21:27
styfle
styfle previously approved these changes Apr 8, 2022
Copy link
Member

@styfle styfle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@styfle styfle merged commit a0924fc into vercel:canary Apr 8, 2022
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
Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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?

@ijjk ijjk deleted the docs/x-nextjs-cache branch April 11, 2022 13:28
colinhacks pushed a commit to colinhacks/next.js that referenced this pull request Apr 14, 2022
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>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
created-by: Next.js team PRs by the Next.js team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants