@@ -132,13 +132,18 @@ export class NetlifyCacheHandler implements CacheHandler {
132132
133133 if (
134134 cacheValue . kind === 'PAGE' ||
135+ cacheValue . kind === 'PAGES' ||
135136 cacheValue . kind === 'APP_PAGE' ||
136- cacheValue . kind === 'ROUTE'
137+ cacheValue . kind === 'ROUTE' ||
138+ cacheValue . kind === 'APP_ROUTE'
137139 ) {
138140 if ( cacheValue . headers ?. [ NEXT_CACHE_TAGS_HEADER ] ) {
139141 const cacheTags = ( cacheValue . headers [ NEXT_CACHE_TAGS_HEADER ] as string ) . split ( ',' )
140142 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+ ) {
142147 // pages router doesn't have cache tags headers in PAGE cache value
143148 // so we need to generate appropriate cache tags for it
144149 const cacheTags = [ `_N_T_${ key === '/index' ? '/' : key } ` ]
@@ -186,6 +191,7 @@ export class NetlifyCacheHandler implements CacheHandler {
186191 }
187192
188193 async get ( ...args : Parameters < CacheHandler [ 'get' ] > ) : ReturnType < CacheHandler [ 'get' ] > {
194+ debugger
189195 return this . tracer . withActiveSpan ( 'get cache key' , async ( span ) => {
190196 const [ key , ctx = { } ] = args
191197 getLogger ( ) . debug ( `[NetlifyCacheHandler.get]: ${ key } ` )
@@ -224,8 +230,9 @@ export class NetlifyCacheHandler implements CacheHandler {
224230 value : blob . value ,
225231 }
226232
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 } )
229236
230237 const valueWithoutRevalidate = this . captureRouteRevalidateAndRemoveFromObject ( blob . value )
231238
@@ -237,7 +244,8 @@ export class NetlifyCacheHandler implements CacheHandler {
237244 } ,
238245 }
239246 }
240- case 'PAGE' : {
247+ case 'PAGE' :
248+ case 'PAGES' : {
241249 span . addEvent ( 'PAGE' , { lastModified : blob . lastModified } )
242250
243251 const { revalidate, ...restOfPageValue } = blob . value
@@ -275,15 +283,15 @@ export class NetlifyCacheHandler implements CacheHandler {
275283 data : Parameters < IncrementalCache [ 'set' ] > [ 1 ] ,
276284 context : Parameters < IncrementalCache [ 'set' ] > [ 2 ] ,
277285 ) : NetlifyIncrementalCacheValue | null {
278- if ( data ?. kind === 'ROUTE' ) {
286+ if ( data ?. kind === 'ROUTE' || data ?. kind === 'APP_ROUTE' ) {
279287 return {
280288 ...data ,
281289 revalidate : context . revalidate ,
282290 body : data . body . toString ( 'base64' ) ,
283291 }
284292 }
285293
286- if ( data ?. kind === 'PAGE' ) {
294+ if ( data ?. kind === 'PAGE' || data ?. kind === 'PAGES' ) {
287295 return {
288296 ...data ,
289297 revalidate : context . revalidate ,
@@ -397,8 +405,10 @@ export class NetlifyCacheHandler implements CacheHandler {
397405 cacheTags = [ ...tags , ...softTags ]
398406 } else if (
399407 cacheEntry . value ?. kind === 'PAGE' ||
408+ cacheEntry . value ?. kind === 'PAGES' ||
400409 cacheEntry . value ?. kind === 'APP_PAGE' ||
401- cacheEntry . value ?. kind === 'ROUTE'
410+ cacheEntry . value ?. kind === 'ROUTE' ||
411+ cacheEntry . value ?. kind === 'APP_ROUTE'
402412 ) {
403413 cacheTags = ( cacheEntry . value . headers ?. [ NEXT_CACHE_TAGS_HEADER ] as string ) ?. split ( ',' ) || [ ]
404414 } else {
0 commit comments