File tree 2 files changed +17
-1
lines changed
test/production/prerender-prefetch
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -1134,7 +1134,9 @@ export const defaultConfig: NextConfig = {
1134
1134
keepAlive : true ,
1135
1135
} ,
1136
1136
logging : { } ,
1137
- expireTime : 31536000 , // one year
1137
+ expireTime : process . env . NEXT_PRIVATE_CDN_CONSUMED_SWR_CACHE_CONTROL
1138
+ ? undefined
1139
+ : 31536000 , // one year
1138
1140
staticPageGenerationTimeout : 60 ,
1139
1141
output : ! ! process . env . NEXT_PRIVATE_STANDALONE ? 'standalone' : undefined ,
1140
1142
modularizeImports : undefined ,
Original file line number Diff line number Diff line change @@ -300,6 +300,13 @@ describe('Prerender prefetch', () => {
300
300
pages : new FileRef ( join ( __dirname , 'app/pages' ) ) ,
301
301
} ,
302
302
dependencies : { } ,
303
+ env : {
304
+ // Simulate that a CDN has consumed the SWR cache-control header,
305
+ // otherwise the browser will cache responses and which messes with
306
+ // the expectations in this test.
307
+ // See https://github.com/vercel/next.js/pull/70674 for context.
308
+ NEXT_PRIVATE_CDN_CONSUMED_SWR_CACHE_CONTROL : '1' ,
309
+ } ,
303
310
} )
304
311
} )
305
312
afterAll ( ( ) => next . destroy ( ) )
@@ -319,6 +326,13 @@ describe('Prerender prefetch', () => {
319
326
} ,
320
327
} ,
321
328
dependencies : { } ,
329
+ env : {
330
+ // Simulate that a CDN has consumed the SWR cache-control header,
331
+ // otherwise the browser will cache responses and which messes with
332
+ // the expectations in this test.
333
+ // See https://github.com/vercel/next.js/pull/70674 for context.
334
+ NEXT_PRIVATE_CDN_CONSUMED_SWR_CACHE_CONTROL : '1' ,
335
+ } ,
322
336
} )
323
337
} )
324
338
afterAll ( ( ) => next . destroy ( ) )
You can’t perform that action at this time.
0 commit comments