File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
packages/open-next/src/core/routing Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @opennextjs/aws " : patch
3+ ---
4+
5+ fix cache interceptor for index page
Original file line number Diff line number Diff line change @@ -146,22 +146,20 @@ export async function cacheInterceptor(
146146 }
147147 // We also need to remove trailing slash
148148 localizedPath = localizedPath . replace ( / \/ $ / , "" ) ;
149- // If empty path, it means we want index
150- if ( localizedPath === "" ) {
151- localizedPath = "index" ;
152- }
153149
154150 debug ( "Checking cache for" , localizedPath , PrerenderManifest ) ;
155151
156152 const isISR =
157- Object . keys ( PrerenderManifest . routes ) . includes ( localizedPath ) ||
153+ Object . keys ( PrerenderManifest . routes ) . includes ( localizedPath ?? "/" ) ||
158154 Object . values ( PrerenderManifest . dynamicRoutes ) . some ( ( dr ) =>
159155 new RegExp ( dr . routeRegex ) . test ( localizedPath ) ,
160156 ) ;
161157 debug ( "isISR" , isISR ) ;
162158 if ( isISR ) {
163159 try {
164- const cachedData = await globalThis . incrementalCache . get ( localizedPath ) ;
160+ const cachedData = await globalThis . incrementalCache . get (
161+ localizedPath ?? "/index" ,
162+ ) ;
165163 debug ( "cached data in interceptor" , cachedData ) ;
166164
167165 if ( ! cachedData ?. value ) {
You can’t perform that action at this time.
0 commit comments