File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -345,6 +345,12 @@ export class NetlifyCacheHandler implements CacheHandlerForMultipleVersions {
345
345
if ( requestContext ?. didPagesRouterOnDemandRevalidate ) {
346
346
// encode here to deal with non ASCII characters in the key
347
347
const tag = `_N_T_${ key === '/index' ? '/' : encodeURI ( key ) } `
348
+ const tags = tag . split ( / , | % 2 c / gi)
349
+
350
+ if ( tags . length === 0 ) {
351
+ return
352
+ }
353
+
348
354
getLogger ( ) . debug ( `Purging CDN cache for: [${ tag } ]` )
349
355
requestContext . trackBackgroundWork (
350
356
purgeCache ( { tags : tag . split ( / , | % 2 c / gi) } ) . catch ( ( error ) => {
@@ -379,6 +385,10 @@ export class NetlifyCacheHandler implements CacheHandlerForMultipleVersions {
379
385
tag . split ( / , | % 2 c / gi) ,
380
386
)
381
387
388
+ if ( tags . length === 0 ) {
389
+ return
390
+ }
391
+
382
392
const data : TagManifest = {
383
393
revalidatedAt : Date . now ( ) ,
384
394
}
You can’t perform that action at this time.
0 commit comments