File tree 2 files changed +14
-1
lines changed
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -84,11 +84,14 @@ export default class CustomFileSystemCache extends FileSystemCache {
84
84
85
85
public async clearGlobalCache ( ) {
86
86
localCache . clear ( ) ;
87
+ redisCache . clear ( ) ;
87
88
return true ;
88
89
}
89
90
90
91
public async deleteGlobalCacheEntry ( path : string ) {
91
92
const pagePath = path === '/' ? '/index' : path ;
92
- return localCache . delete ( pagePath ) ;
93
+ localCache . delete ( pagePath ) ;
94
+ redisCache . delete ( pagePath ) ;
95
+ return true ;
93
96
}
94
97
}
Original file line number Diff line number Diff line change @@ -85,6 +85,16 @@ export class RedisCache {
85
85
} ) ;
86
86
}
87
87
88
+ public async delete ( key : string ) {
89
+ console . log ( 'Clearing redis cache!' ) ;
90
+ return this . client . del ( this . getFullKey ( key ) ) ;
91
+ }
92
+
93
+ public async clear ( ) {
94
+ console . log ( 'Clearing redis cache!' ) ;
95
+ return this . client . flushDb ( ) ;
96
+ }
97
+
88
98
private getFullKey ( key : string ) {
89
99
return `${ this . keyPrefix } _${ key } ` ;
90
100
}
You can’t perform that action at this time.
0 commit comments