Skip to content

Commit

Permalink
Update image.md (#39984)
Browse files Browse the repository at this point in the history
Update the cache behavior with the correct Header name. Updated header name from `x-nextjs-cache` to `x-vercel-cache`

Co-authored-by: JJ Kasper <jj@jjsweb.site>
  • Loading branch information
AdilAmanat and ijjk committed Aug 26, 2022
1 parent 27a519b commit e5997dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/api-reference/next/image.md
Expand Up @@ -512,7 +512,7 @@ The following describes the caching algorithm for the default [loader](#loader).

Images are optimized dynamically upon request and stored in the `<distDir>/cache/images` directory. The optimized image file will be served for subsequent requests until the expiration is reached. When a request is made that matches a cached but expired file, the expired image is served stale immediately. Then the image is optimized again in the background (also called revalidation) and saved to the cache with the new expiration date.

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:
The cache status of an image can be determined by reading the value of the `x-nextjs-cache` (`x-vercel-cache` when deployed on Vercel) 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
Expand Down

0 comments on commit e5997dc

Please sign in to comment.