From 3a7c89fd1291a43ac6a372c78a398a58a997d3e1 Mon Sep 17 00:00:00 2001 From: Adil Amanat Date: Sat, 27 Aug 2022 00:02:04 +0500 Subject: [PATCH 1/2] Update image.md Update the cache behavior with the correct Header name. Updated header name from `x-nextjs-cache` to `x-vercel-cache` --- docs/api-reference/next/image.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api-reference/next/image.md b/docs/api-reference/next/image.md index e9c2c526ab10..3f819c932a91 100644 --- a/docs/api-reference/next/image.md +++ b/docs/api-reference/next/image.md @@ -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 `/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-vercel-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 From 0a10c9f355c3b977f35e6e2e5c43c65ce03832bb Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Fri, 26 Aug 2022 15:11:49 -0500 Subject: [PATCH 2/2] Apply suggestions from code review --- docs/api-reference/next/image.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api-reference/next/image.md b/docs/api-reference/next/image.md index 3f819c932a91..c27c822fb76e 100644 --- a/docs/api-reference/next/image.md +++ b/docs/api-reference/next/image.md @@ -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 `/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-vercel-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