@@ -132,13 +132,18 @@ export class NetlifyCacheHandler implements CacheHandler {
132
132
133
133
if (
134
134
cacheValue . kind === 'PAGE' ||
135
+ cacheValue . kind === 'PAGES' ||
135
136
cacheValue . kind === 'APP_PAGE' ||
136
- cacheValue . kind === 'ROUTE'
137
+ cacheValue . kind === 'ROUTE' ||
138
+ cacheValue . kind === 'APP_ROUTE'
137
139
) {
138
140
if ( cacheValue . headers ?. [ NEXT_CACHE_TAGS_HEADER ] ) {
139
141
const cacheTags = ( cacheValue . headers [ NEXT_CACHE_TAGS_HEADER ] as string ) . split ( ',' )
140
142
requestContext . responseCacheTags = cacheTags
141
- } else if ( cacheValue . kind === 'PAGE' && typeof cacheValue . pageData === 'object' ) {
143
+ } else if (
144
+ ( cacheValue . kind === 'PAGE' || cacheValue . kind === 'PAGES' ) &&
145
+ typeof cacheValue . pageData === 'object'
146
+ ) {
142
147
// pages router doesn't have cache tags headers in PAGE cache value
143
148
// so we need to generate appropriate cache tags for it
144
149
const cacheTags = [ `_N_T_${ key === '/index' ? '/' : key } ` ]
@@ -186,6 +191,7 @@ export class NetlifyCacheHandler implements CacheHandler {
186
191
}
187
192
188
193
async get ( ...args : Parameters < CacheHandler [ 'get' ] > ) : ReturnType < CacheHandler [ 'get' ] > {
194
+ debugger
189
195
return this . tracer . withActiveSpan ( 'get cache key' , async ( span ) => {
190
196
const [ key , ctx = { } ] = args
191
197
getLogger ( ) . debug ( `[NetlifyCacheHandler.get]: ${ key } ` )
@@ -224,8 +230,9 @@ export class NetlifyCacheHandler implements CacheHandler {
224
230
value : blob . value ,
225
231
}
226
232
227
- case 'ROUTE' : {
228
- span . addEvent ( 'ROUTE' , { lastModified : blob . lastModified , status : blob . value . status } )
233
+ case 'ROUTE' :
234
+ case 'APP_ROUTE' : {
235
+ span . addEvent ( 'APP_ROUTE' , { lastModified : blob . lastModified , status : blob . value . status } )
229
236
230
237
const valueWithoutRevalidate = this . captureRouteRevalidateAndRemoveFromObject ( blob . value )
231
238
@@ -237,7 +244,8 @@ export class NetlifyCacheHandler implements CacheHandler {
237
244
} ,
238
245
}
239
246
}
240
- case 'PAGE' : {
247
+ case 'PAGE' :
248
+ case 'PAGES' : {
241
249
span . addEvent ( 'PAGE' , { lastModified : blob . lastModified } )
242
250
243
251
const { revalidate, ...restOfPageValue } = blob . value
@@ -275,15 +283,15 @@ export class NetlifyCacheHandler implements CacheHandler {
275
283
data : Parameters < IncrementalCache [ 'set' ] > [ 1 ] ,
276
284
context : Parameters < IncrementalCache [ 'set' ] > [ 2 ] ,
277
285
) : NetlifyIncrementalCacheValue | null {
278
- if ( data ?. kind === 'ROUTE' ) {
286
+ if ( data ?. kind === 'ROUTE' || data ?. kind === 'APP_ROUTE' ) {
279
287
return {
280
288
...data ,
281
289
revalidate : context . revalidate ,
282
290
body : data . body . toString ( 'base64' ) ,
283
291
}
284
292
}
285
293
286
- if ( data ?. kind === 'PAGE' ) {
294
+ if ( data ?. kind === 'PAGE' || data ?. kind === 'PAGES' ) {
287
295
return {
288
296
...data ,
289
297
revalidate : context . revalidate ,
@@ -397,8 +405,10 @@ export class NetlifyCacheHandler implements CacheHandler {
397
405
cacheTags = [ ...tags , ...softTags ]
398
406
} else if (
399
407
cacheEntry . value ?. kind === 'PAGE' ||
408
+ cacheEntry . value ?. kind === 'PAGES' ||
400
409
cacheEntry . value ?. kind === 'APP_PAGE' ||
401
- cacheEntry . value ?. kind === 'ROUTE'
410
+ cacheEntry . value ?. kind === 'ROUTE' ||
411
+ cacheEntry . value ?. kind === 'APP_ROUTE'
402
412
) {
403
413
cacheTags = ( cacheEntry . value . headers ?. [ NEXT_CACHE_TAGS_HEADER ] as string ) ?. split ( ',' ) || [ ]
404
414
} else {
0 commit comments