删除Partial缓存时,同时删除区间范围相关文件

This commit is contained in:
刘祥超
2022-03-04 11:51:59 +08:00
parent 581a3d49fc
commit 269e33b9a0
10 changed files with 85 additions and 64 deletions

View File

@@ -352,14 +352,14 @@ func (this *APIStream) handlePurgeCache(message *pb.NodeStreamMessage) error {
var keys = msg.Keys
for _, key := range keys {
keys = append(keys,
key+cacheMethodSuffix+"HEAD",
key+webpCacheSuffix,
key+cachePartialSuffix,
key+caches.SuffixMethod+"HEAD",
key+caches.SuffixWebP,
key+caches.SuffixPartial,
)
// TODO 根据实际缓存的内容进行组合
for _, encoding := range compressions.AllEncodings() {
keys = append(keys, key+compressionCacheSuffix+encoding)
keys = append(keys, key+webpCacheSuffix+compressionCacheSuffix+encoding)
keys = append(keys, key+caches.SuffixCompression+encoding)
keys = append(keys, key+caches.SuffixWebP+caches.SuffixCompression+encoding)
}
}
msg.Keys = keys