File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ const makeE2EFixture = (
14
14
15
15
export const test = base . extend <
16
16
{
17
+ ensureStaticAssetsHaveImmutableCacheControl : void
17
18
takeScreenshot : void
18
19
pollUntilHeadersMatch : (
19
20
url : string ,
@@ -91,4 +92,19 @@ export const test = base.extend<
91
92
} ,
92
93
{ auto : true } ,
93
94
] ,
95
+ ensureStaticAssetsHaveImmutableCacheControl : [
96
+ async ( { page } , use ) => {
97
+ page . on ( 'response' , ( response ) => {
98
+ if ( response . url ( ) . includes ( '/_next/static/' ) ) {
99
+ expect (
100
+ response . headers ( ) [ 'cache-control' ] ,
101
+ '_next/static assets should have immutable cache control' ,
102
+ ) . toContain ( 'public,max-age=31536000,immutable' )
103
+ }
104
+ } )
105
+
106
+ await use ( )
107
+ } ,
108
+ { auto : true } ,
109
+ ] ,
94
110
} )
You can’t perform that action at this time.
0 commit comments