File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,9 @@ export class NetlifyCacheHandler implements CacheHandlerForMultipleVersions {
147
147
) {
148
148
// pages router doesn't have cache tags headers in PAGE cache value
149
149
// so we need to generate appropriate cache tags for it
150
- const cacheTags = [ `_N_T_${ key === '/index' ? '/' : key } ` ]
150
+ // encode here to deal with non ASCII characters in the key
151
+
152
+ const cacheTags = [ `_N_T_${ key === '/index' ? '/' : encodeURI ( key ) } ` ]
151
153
requestContext . responseCacheTags = cacheTags
152
154
}
153
155
}
@@ -341,7 +343,8 @@ export class NetlifyCacheHandler implements CacheHandlerForMultipleVersions {
341
343
if ( data ?. kind === 'PAGE' || data ?. kind === 'PAGES' ) {
342
344
const requestContext = getRequestContext ( )
343
345
if ( requestContext ?. didPagesRouterOnDemandRevalidate ) {
344
- const tag = `_N_T_${ key === '/index' ? '/' : key } `
346
+ // encode here to deal with non ASCII characters in the key
347
+ const tag = `_N_T_${ key === '/index' ? '/' : encodeURI ( key ) } `
345
348
getLogger ( ) . debug ( `Purging CDN cache for: [${ tag } ]` )
346
349
requestContext . trackBackgroundWork (
347
350
purgeCache ( { tags : [ tag ] } ) . catch ( ( error ) => {
You can’t perform that action at this time.
0 commit comments