Unverified Commit e5997dce authored by Adil Amanat's avatar Adil Amanat Committed by GitHub

Update image.md (#39984)

Update the cache behavior with the correct Header name. Updated header name from `x-nextjs-cache` to `x-vercel-cache`
Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
parent 27a519ba
...@@ -512,7 +512,7 @@ The following describes the caching algorithm for the default [loader](#loader). ...@@ -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. 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) - `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 - `STALE` - the path is in the cache but exceeded the revalidate time so it will be updated in the background
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment