From a9a3520744be5204d7358175d56deac0da37cd80 Mon Sep 17 00:00:00 2001 From: samcx Date: Wed, 20 Mar 2024 21:02:41 -0700 Subject: [PATCH 01/15] fix(fetch-cache): add check for updated tags when checking same cache key --- .../lib/incremental-cache/fetch-cache.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/next/src/server/lib/incremental-cache/fetch-cache.ts b/packages/next/src/server/lib/incremental-cache/fetch-cache.ts index d275d7147ebc5..7afe53f5db54d 100644 --- a/packages/next/src/server/lib/incremental-cache/fetch-cache.ts +++ b/packages/next/src/server/lib/incremental-cache/fetch-cache.ts @@ -168,8 +168,15 @@ export default class FetchCache implements CacheHandler { // on successive requests let data = memoryCache?.get(key) - // get data from fetch cache - if (!data && this.cacheEndpoint) { + const isCacheable = !data && this.cacheEndpoint + const hasFetchKindAndIncludesTags = + tags?.every( + (tag) => data?.value?.kind === 'FETCH' && data.value.tags?.includes(tag) + ) ?? false + + // Get data from fetch cache. Also check if new tags have been + // specified with the same cache key (fetch URL) + if (isCacheable || hasFetchKindAndIncludesTags) { try { const start = Date.now() const fetchParams: NextFetchCacheParams = { @@ -220,6 +227,13 @@ export default class FetchCache implements CacheHandler { throw new Error(`invalid cache value`) } + // if new tags were specified, merge those tags to the existing tags + if (data?.value?.kind === 'FETCH') { + data.value.tags = [ + ...new Set([...(data.value.tags ?? []), ...(tags ?? [])]), + ] + } + const cacheState = res.headers.get(CACHE_STATE_HEADER) const age = res.headers.get('age') From 98ff8fa518037096f2294e25d5cd6166ce486d49 Mon Sep 17 00:00:00 2001 From: samcx Date: Wed, 20 Mar 2024 21:22:42 -0700 Subject: [PATCH 02/15] fix(fetch-cache): removing unnecessary 'FETCH' check --- .../next/src/server/lib/incremental-cache/fetch-cache.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/next/src/server/lib/incremental-cache/fetch-cache.ts b/packages/next/src/server/lib/incremental-cache/fetch-cache.ts index 7afe53f5db54d..b1d511ad5aeea 100644 --- a/packages/next/src/server/lib/incremental-cache/fetch-cache.ts +++ b/packages/next/src/server/lib/incremental-cache/fetch-cache.ts @@ -228,11 +228,7 @@ export default class FetchCache implements CacheHandler { } // if new tags were specified, merge those tags to the existing tags - if (data?.value?.kind === 'FETCH') { - data.value.tags = [ - ...new Set([...(data.value.tags ?? []), ...(tags ?? [])]), - ] - } + cached.tags = [...new Set([...(cached.tags ?? []), ...(tags ?? [])])] const cacheState = res.headers.get(CACHE_STATE_HEADER) const age = res.headers.get('age') From 2cd7f6c84fa4d324924d9f8027bed411e42c79c8 Mon Sep 17 00:00:00 2001 From: samcx Date: Wed, 20 Mar 2024 21:27:46 -0700 Subject: [PATCH 03/15] fix(fetch-cache): re-add 'FETCH' check --- packages/next/src/server/lib/incremental-cache/fetch-cache.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/next/src/server/lib/incremental-cache/fetch-cache.ts b/packages/next/src/server/lib/incremental-cache/fetch-cache.ts index b1d511ad5aeea..9cf35404dc998 100644 --- a/packages/next/src/server/lib/incremental-cache/fetch-cache.ts +++ b/packages/next/src/server/lib/incremental-cache/fetch-cache.ts @@ -228,7 +228,9 @@ export default class FetchCache implements CacheHandler { } // if new tags were specified, merge those tags to the existing tags - cached.tags = [...new Set([...(cached.tags ?? []), ...(tags ?? [])])] + if (cached.kind === 'FETCH') { + cached.tags = [...new Set([...(cached.tags ?? []), ...(tags ?? [])])] + } const cacheState = res.headers.get(CACHE_STATE_HEADER) const age = res.headers.get('age') From 53030bcbb4b73b7eb1159f08ed75275fd151f17a Mon Sep 17 00:00:00 2001 From: samcx Date: Thu, 21 Mar 2024 14:51:11 -0700 Subject: [PATCH 04/15] fix(fetch-cache): add minor tweaks --- .../src/server/lib/incremental-cache/fetch-cache.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/next/src/server/lib/incremental-cache/fetch-cache.ts b/packages/next/src/server/lib/incremental-cache/fetch-cache.ts index 9cf35404dc998..1f6f5110e8174 100644 --- a/packages/next/src/server/lib/incremental-cache/fetch-cache.ts +++ b/packages/next/src/server/lib/incremental-cache/fetch-cache.ts @@ -169,14 +169,16 @@ export default class FetchCache implements CacheHandler { let data = memoryCache?.get(key) const isCacheable = !data && this.cacheEndpoint - const hasFetchKindAndIncludesTags = - tags?.every( - (tag) => data?.value?.kind === 'FETCH' && data.value.tags?.includes(tag) - ) ?? false + const hasFetchKindAndIncludesAllTags = tags?.every((tag) => { + if (data?.value?.kind !== 'FETCH') { + return false + } + return data.value.tags?.includes(tag) + }) // Get data from fetch cache. Also check if new tags have been // specified with the same cache key (fetch URL) - if (isCacheable || hasFetchKindAndIncludesTags) { + if (isCacheable || !hasFetchKindAndIncludesAllTags) { try { const start = Date.now() const fetchParams: NextFetchCacheParams = { From 1b804efe3178ed7b3875db0a47124bdb884cc0b2 Mon Sep 17 00:00:00 2001 From: Sam Ko Date: Tue, 26 Mar 2024 15:58:35 -0700 Subject: [PATCH 05/15] fix(fetch-cache): add suggested changes Co-authored-by: Ethan Arrowood --- .../next/src/server/lib/incremental-cache/fetch-cache.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/next/src/server/lib/incremental-cache/fetch-cache.ts b/packages/next/src/server/lib/incremental-cache/fetch-cache.ts index 1f6f5110e8174..aa0935754b7a8 100644 --- a/packages/next/src/server/lib/incremental-cache/fetch-cache.ts +++ b/packages/next/src/server/lib/incremental-cache/fetch-cache.ts @@ -170,10 +170,7 @@ export default class FetchCache implements CacheHandler { const isCacheable = !data && this.cacheEndpoint const hasFetchKindAndIncludesAllTags = tags?.every((tag) => { - if (data?.value?.kind !== 'FETCH') { - return false - } - return data.value.tags?.includes(tag) + return data?.value?.kind === 'FETCH' && data.value.tags?.includes(tag) }) // Get data from fetch cache. Also check if new tags have been From d48182d23a0c16bd8452b19953d1255e9f55cd3e Mon Sep 17 00:00:00 2001 From: samcx Date: Tue, 26 Mar 2024 17:13:02 -0700 Subject: [PATCH 06/15] fix(fetch-cache): add more suggested changes --- .../lib/incremental-cache/fetch-cache.ts | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/packages/next/src/server/lib/incremental-cache/fetch-cache.ts b/packages/next/src/server/lib/incremental-cache/fetch-cache.ts index aa0935754b7a8..f75b797d70fe9 100644 --- a/packages/next/src/server/lib/incremental-cache/fetch-cache.ts +++ b/packages/next/src/server/lib/incremental-cache/fetch-cache.ts @@ -28,6 +28,21 @@ export default class FetchCache implements CacheHandler { private cacheEndpoint?: string private debug: boolean + private hasMatchingTags(arr1: string[], arr2: string[]) { + if (arr1.length !== arr2.length) return false + + const set1 = new Set(arr1) + const set2 = new Set(arr2) + + if (set1.size !== set2.size) return false + + for (let tag of set1) { + if (!set2.has(tag)) return false + } + + return true + } + static isAvailable(ctx: { _requestHeaders: CacheHandlerContext['_requestHeaders'] }) { @@ -168,14 +183,13 @@ export default class FetchCache implements CacheHandler { // on successive requests let data = memoryCache?.get(key) - const isCacheable = !data && this.cacheEndpoint - const hasFetchKindAndIncludesAllTags = tags?.every((tag) => { - return data?.value?.kind === 'FETCH' && data.value.tags?.includes(tag) - }) + const hasFetchKindAndMatchingTags = + data?.value?.kind === 'FETCH' && + this.hasMatchingTags(tags ?? [], data.value.tags ?? []) // Get data from fetch cache. Also check if new tags have been // specified with the same cache key (fetch URL) - if (isCacheable || !hasFetchKindAndIncludesAllTags) { + if (this.cacheEndpoint && (!data || !hasFetchKindAndMatchingTags)) { try { const start = Date.now() const fetchParams: NextFetchCacheParams = { From b7a5a33815c3b90021bc560eb669b097de790549 Mon Sep 17 00:00:00 2001 From: samcx Date: Fri, 5 Apr 2024 17:10:45 -0400 Subject: [PATCH 07/15] fix(fetch-cache): add test --- .../e2e/app-dir/app-static/app-static.test.ts | 12 +++++++++ .../app-static/app/mismatch-tags/page.tsx | 26 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 test/e2e/app-dir/app-static/app/mismatch-tags/page.tsx diff --git a/test/e2e/app-dir/app-static/app-static.test.ts b/test/e2e/app-dir/app-static/app-static.test.ts index 08b1beaf28637..f39ebd8fde753 100644 --- a/test/e2e/app-dir/app-static/app-static.test.ts +++ b/test/e2e/app-dir/app-static/app-static.test.ts @@ -49,6 +49,18 @@ createNextDescribe( }) }) + it('should refetch from origin if new tags have been specified', async () => { + const res = await next.fetch('/mismatch-tags') + expect(res.status).toBe(200) + + const html = await res.text() + const $ = cheerio.load(html) + + const data1 = $('#page-data').text() + const data2 = $('#page-data-2').text() + expect(data1).not.toBe(data2) + }) + if (isNextStart) { it('should propagate unstable_cache tags correctly', async () => { const meta = JSON.parse( diff --git a/test/e2e/app-dir/app-static/app/mismatch-tags/page.tsx b/test/e2e/app-dir/app-static/app/mismatch-tags/page.tsx new file mode 100644 index 0000000000000..0212d42f5c4a5 --- /dev/null +++ b/test/e2e/app-dir/app-static/app/mismatch-tags/page.tsx @@ -0,0 +1,26 @@ +export default async function Page() { + const data = await fetch( + 'https://next-data-api-endpoint.vercel.app/api/random', + { + next: { tags: ['thankyounext'] }, + } + ).then((res) => res.text()) + + console.log('[bruh] data =', data) + + const data2 = await fetch( + 'https://next-data-api-endpoint.vercel.app/api/random', + { + next: { tags: ['thankyounext', 'justputit'] }, + } + ).then((res) => res.text()) + + console.log('[bruh] data2 =', data2) + + return ( + <> +

data: {data}

+

data: {data2}

+ + ) +} From c2f985a517737d9f8d6b360b8697c16a005a404b Mon Sep 17 00:00:00 2001 From: samcx Date: Fri, 5 Apr 2024 17:14:12 -0400 Subject: [PATCH 08/15] fix(fetch-cache): remove comments --- test/e2e/app-dir/app-static/app/mismatch-tags/page.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/e2e/app-dir/app-static/app/mismatch-tags/page.tsx b/test/e2e/app-dir/app-static/app/mismatch-tags/page.tsx index 0212d42f5c4a5..a54d9f2118c99 100644 --- a/test/e2e/app-dir/app-static/app/mismatch-tags/page.tsx +++ b/test/e2e/app-dir/app-static/app/mismatch-tags/page.tsx @@ -6,8 +6,6 @@ export default async function Page() { } ).then((res) => res.text()) - console.log('[bruh] data =', data) - const data2 = await fetch( 'https://next-data-api-endpoint.vercel.app/api/random', { @@ -15,8 +13,6 @@ export default async function Page() { } ).then((res) => res.text()) - console.log('[bruh] data2 =', data2) - return ( <>

data: {data}

From 76e9425d601e98d4da2a6e24f7ddc56a63dee7f4 Mon Sep 17 00:00:00 2001 From: samcx Date: Fri, 5 Apr 2024 17:19:39 -0400 Subject: [PATCH 09/15] test(fetch-cache): update test title --- test/e2e/app-dir/app-static/app-static.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/app-dir/app-static/app-static.test.ts b/test/e2e/app-dir/app-static/app-static.test.ts index f39ebd8fde753..41ecca3483aed 100644 --- a/test/e2e/app-dir/app-static/app-static.test.ts +++ b/test/e2e/app-dir/app-static/app-static.test.ts @@ -49,7 +49,7 @@ createNextDescribe( }) }) - it('should refetch from origin if new tags have been specified', async () => { + it('should not fetch from memory cache if new tags have been specified', async () => { const res = await next.fetch('/mismatch-tags') expect(res.status).toBe(200) From c83128b156a628adbd5360e4bd58ca6b46f1a737 Mon Sep 17 00:00:00 2001 From: samcx Date: Fri, 5 Apr 2024 17:43:29 -0400 Subject: [PATCH 10/15] test(fetch-cache): update test --- .../e2e/app-dir/app-static/app-static.test.ts | 20 ++++++++++--------- .../app-static/app/mismatch-tags/page.tsx | 2 ++ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/test/e2e/app-dir/app-static/app-static.test.ts b/test/e2e/app-dir/app-static/app-static.test.ts index 41ecca3483aed..7b9094c273281 100644 --- a/test/e2e/app-dir/app-static/app-static.test.ts +++ b/test/e2e/app-dir/app-static/app-static.test.ts @@ -49,17 +49,19 @@ createNextDescribe( }) }) - it('should not fetch from memory cache if new tags have been specified', async () => { - const res = await next.fetch('/mismatch-tags') - expect(res.status).toBe(200) + if (isNextDeploy) { + it('should not fetch from memory cache if new tags have been specified', async () => { + const res = await next.fetch('/mismatch-tags') + expect(res.status).toBe(200) - const html = await res.text() - const $ = cheerio.load(html) + const html = await res.text() + const $ = cheerio.load(html) - const data1 = $('#page-data').text() - const data2 = $('#page-data-2').text() - expect(data1).not.toBe(data2) - }) + const data1 = $('#page-data').text() + const data2 = $('#page-data-2').text() + expect(data1).not.toBe(data2) + }) + } if (isNextStart) { it('should propagate unstable_cache tags correctly', async () => { diff --git a/test/e2e/app-dir/app-static/app/mismatch-tags/page.tsx b/test/e2e/app-dir/app-static/app/mismatch-tags/page.tsx index a54d9f2118c99..07b2f6966af60 100644 --- a/test/e2e/app-dir/app-static/app/mismatch-tags/page.tsx +++ b/test/e2e/app-dir/app-static/app/mismatch-tags/page.tsx @@ -2,6 +2,7 @@ export default async function Page() { const data = await fetch( 'https://next-data-api-endpoint.vercel.app/api/random', { + cache: 'no-store', next: { tags: ['thankyounext'] }, } ).then((res) => res.text()) @@ -9,6 +10,7 @@ export default async function Page() { const data2 = await fetch( 'https://next-data-api-endpoint.vercel.app/api/random', { + cache: 'no-store', next: { tags: ['thankyounext', 'justputit'] }, } ).then((res) => res.text()) From 4f5179ef2a91c26c9e2bfa56d6cd90636b1718e6 Mon Sep 17 00:00:00 2001 From: samcx Date: Fri, 5 Apr 2024 17:46:03 -0400 Subject: [PATCH 11/15] test(fetch-cache): add force-dynamic --- test/e2e/app-dir/app-static/app/mismatch-tags/page.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/e2e/app-dir/app-static/app/mismatch-tags/page.tsx b/test/e2e/app-dir/app-static/app/mismatch-tags/page.tsx index 07b2f6966af60..629d75aa83eec 100644 --- a/test/e2e/app-dir/app-static/app/mismatch-tags/page.tsx +++ b/test/e2e/app-dir/app-static/app/mismatch-tags/page.tsx @@ -1,3 +1,5 @@ +export const dynamic = 'force-dynamic' + export default async function Page() { const data = await fetch( 'https://next-data-api-endpoint.vercel.app/api/random', From e83e602e3eb2ce0f80d7fe12bf49fcbbf4b80574 Mon Sep 17 00:00:00 2001 From: samcx Date: Fri, 5 Apr 2024 17:52:42 -0400 Subject: [PATCH 12/15] test(fetch-cache): fix test --- test/e2e/app-dir/app-static/app-static.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/e2e/app-dir/app-static/app-static.test.ts b/test/e2e/app-dir/app-static/app-static.test.ts index 7b9094c273281..926ab6bdc4e4f 100644 --- a/test/e2e/app-dir/app-static/app-static.test.ts +++ b/test/e2e/app-dir/app-static/app-static.test.ts @@ -680,6 +680,8 @@ createNextDescribe( "isr-error-handling.rsc", "isr-error-handling/page.js", "isr-error-handling/page_client-reference-manifest.js", + "mismatch-tags/page.js", + "mismatch-tags/page_client-reference-manifest.js", "no-store/dynamic/page.js", "no-store/dynamic/page_client-reference-manifest.js", "no-store/static.html", From f3f7bc69fc1a0f16336abe34ee601c846fe2c018 Mon Sep 17 00:00:00 2001 From: samcx Date: Fri, 5 Apr 2024 18:19:03 -0400 Subject: [PATCH 13/15] test(fetch-cache): switch to force-cache --- test/e2e/app-dir/app-static/app/mismatch-tags/page.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/app-dir/app-static/app/mismatch-tags/page.tsx b/test/e2e/app-dir/app-static/app/mismatch-tags/page.tsx index 629d75aa83eec..c2e2363244960 100644 --- a/test/e2e/app-dir/app-static/app/mismatch-tags/page.tsx +++ b/test/e2e/app-dir/app-static/app/mismatch-tags/page.tsx @@ -4,7 +4,7 @@ export default async function Page() { const data = await fetch( 'https://next-data-api-endpoint.vercel.app/api/random', { - cache: 'no-store', + cache: 'force-cache', next: { tags: ['thankyounext'] }, } ).then((res) => res.text()) @@ -12,7 +12,7 @@ export default async function Page() { const data2 = await fetch( 'https://next-data-api-endpoint.vercel.app/api/random', { - cache: 'no-store', + cache: 'force-cache', next: { tags: ['thankyounext', 'justputit'] }, } ).then((res) => res.text()) From c48ce417f325d16c1e242798aa09ac85c306803f Mon Sep 17 00:00:00 2001 From: samcx Date: Tue, 9 Apr 2024 00:08:25 -0400 Subject: [PATCH 14/15] fix(fetch-cache): add suggested changes --- .../next/src/server/lib/incremental-cache/fetch-cache.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/next/src/server/lib/incremental-cache/fetch-cache.ts b/packages/next/src/server/lib/incremental-cache/fetch-cache.ts index f75b797d70fe9..2c6783f8a5a5b 100644 --- a/packages/next/src/server/lib/incremental-cache/fetch-cache.ts +++ b/packages/next/src/server/lib/incremental-cache/fetch-cache.ts @@ -242,7 +242,12 @@ export default class FetchCache implements CacheHandler { // if new tags were specified, merge those tags to the existing tags if (cached.kind === 'FETCH') { - cached.tags = [...new Set([...(cached.tags ?? []), ...(tags ?? [])])] + cached.tags ??= [] + for (const tag of tags ?? []) { + if (!cached.tags.include(tag)) { + cached.tag.push(tag) + } + } } const cacheState = res.headers.get(CACHE_STATE_HEADER) From 947fa92cb7869830e66366fe11670862251477f0 Mon Sep 17 00:00:00 2001 From: samcx Date: Tue, 9 Apr 2024 12:14:10 -0400 Subject: [PATCH 15/15] test(app-static): add another test that revalidatetag's as well --- .../e2e/app-dir/app-static/app-static.test.ts | 51 +++++++++++++++---- .../app-static/app/mismatch-tags/page.tsx | 26 ---------- .../app/specify-new-tags/one-tag/page.tsx | 13 +++++ .../app/specify-new-tags/two-tags/page.tsx | 13 +++++ 4 files changed, 67 insertions(+), 36 deletions(-) delete mode 100644 test/e2e/app-dir/app-static/app/mismatch-tags/page.tsx create mode 100644 test/e2e/app-dir/app-static/app/specify-new-tags/one-tag/page.tsx create mode 100644 test/e2e/app-dir/app-static/app/specify-new-tags/two-tags/page.tsx diff --git a/test/e2e/app-dir/app-static/app-static.test.ts b/test/e2e/app-dir/app-static/app-static.test.ts index 926ab6bdc4e4f..90c735f2f0670 100644 --- a/test/e2e/app-dir/app-static/app-static.test.ts +++ b/test/e2e/app-dir/app-static/app-static.test.ts @@ -50,16 +50,45 @@ createNextDescribe( }) if (isNextDeploy) { - it('should not fetch from memory cache if new tags have been specified', async () => { - const res = await next.fetch('/mismatch-tags') - expect(res.status).toBe(200) + describe('new tags have been specified on subsequent fetch', () => { + it('should not fetch from memory cache', async () => { + const res1 = await next.fetch('/specify-new-tags/one-tag') + expect(res1.status).toBe(200) - const html = await res.text() - const $ = cheerio.load(html) + const res2 = await next.fetch('/specify-new-tags/two-tags') + expect(res2.status).toBe(200) + + const html1 = await res1.text() + const html2 = await res2.text() + const $1 = cheerio.load(html1) + const $2 = cheerio.load(html2) + + const data1 = $1('#page-data').text() + const data2 = $2('#page-data').text() + expect(data1).not.toBe(data2) + }) + + it('should not fetch from memory cache after revalidateTag is used', async () => { + const res1 = await next.fetch('/specify-new-tags/one-tag') + expect(res1.status).toBe(200) - const data1 = $('#page-data').text() - const data2 = $('#page-data-2').text() - expect(data1).not.toBe(data2) + const revalidateRes = await next.fetch( + '/api/revlidate-tag-node?tag=thankyounext' + ) + expect((await revalidateRes.json()).revalidated).toBe(true) + + const res2 = await next.fetch('/specify-new-tags/two-tags') + expect(res2.status).toBe(200) + + const html1 = await res1.text() + const html2 = await res2.text() + const $1 = cheerio.load(html1) + const $2 = cheerio.load(html2) + + const data1 = $1('#page-data').text() + const data2 = $2('#page-data').text() + expect(data1).not.toBe(data2) + }) }) } @@ -680,8 +709,6 @@ createNextDescribe( "isr-error-handling.rsc", "isr-error-handling/page.js", "isr-error-handling/page_client-reference-manifest.js", - "mismatch-tags/page.js", - "mismatch-tags/page_client-reference-manifest.js", "no-store/dynamic/page.js", "no-store/dynamic/page_client-reference-manifest.js", "no-store/static.html", @@ -733,6 +760,10 @@ createNextDescribe( "route-handler/revalidate-360-isr/route.js", "route-handler/revalidate-360/route.js", "route-handler/static-cookies/route.js", + "specify-new-tags/one-tag/page.js", + "specify-new-tags/one-tag/page_client-reference-manifest.js", + "specify-new-tags/two-tags/page.js", + "specify-new-tags/two-tags/page_client-reference-manifest.js", "ssg-draft-mode.html", "ssg-draft-mode.rsc", "ssg-draft-mode/[[...route]]/page.js", diff --git a/test/e2e/app-dir/app-static/app/mismatch-tags/page.tsx b/test/e2e/app-dir/app-static/app/mismatch-tags/page.tsx deleted file mode 100644 index c2e2363244960..0000000000000 --- a/test/e2e/app-dir/app-static/app/mismatch-tags/page.tsx +++ /dev/null @@ -1,26 +0,0 @@ -export const dynamic = 'force-dynamic' - -export default async function Page() { - const data = await fetch( - 'https://next-data-api-endpoint.vercel.app/api/random', - { - cache: 'force-cache', - next: { tags: ['thankyounext'] }, - } - ).then((res) => res.text()) - - const data2 = await fetch( - 'https://next-data-api-endpoint.vercel.app/api/random', - { - cache: 'force-cache', - next: { tags: ['thankyounext', 'justputit'] }, - } - ).then((res) => res.text()) - - return ( - <> -

data: {data}

-

data: {data2}

- - ) -} diff --git a/test/e2e/app-dir/app-static/app/specify-new-tags/one-tag/page.tsx b/test/e2e/app-dir/app-static/app/specify-new-tags/one-tag/page.tsx new file mode 100644 index 0000000000000..6b940fa39f78c --- /dev/null +++ b/test/e2e/app-dir/app-static/app/specify-new-tags/one-tag/page.tsx @@ -0,0 +1,13 @@ +export const dynamic = 'force-dynamic' + +export default async function Page() { + const data = await fetch( + 'https://next-data-api-endpoint.vercel.app/api/random?sam=iam', + { + cache: 'force-cache', + next: { tags: ['thankyounext'] }, + } + ).then((res) => res.text()) + + return

data: {data}

+} diff --git a/test/e2e/app-dir/app-static/app/specify-new-tags/two-tags/page.tsx b/test/e2e/app-dir/app-static/app/specify-new-tags/two-tags/page.tsx new file mode 100644 index 0000000000000..7406a0445a392 --- /dev/null +++ b/test/e2e/app-dir/app-static/app/specify-new-tags/two-tags/page.tsx @@ -0,0 +1,13 @@ +export const dynamic = 'force-dynamic' + +export default async function Page() { + const data = await fetch( + 'https://next-data-api-endpoint.vercel.app/api/random?sam=iam', + { + cache: 'force-cache', + next: { tags: ['thankyounext', 'justputit'] }, + } + ).then((res) => res.text()) + + return

data: {data}

+}