优化WebP+缓存

This commit is contained in:
刘祥超
2021-10-03 18:00:57 +08:00
parent 38a7cc17da
commit adadb52d4e
4 changed files with 42 additions and 12 deletions

View File

@@ -342,6 +342,15 @@ func (this *APIStream) handlePurgeCache(message *pb.NodeStreamMessage) error {
}()
}
// WEBP缓存
if msg.Type == "file" {
var keys = msg.Keys
for _, key := range keys {
keys = append(keys, key+webpSuffix)
}
msg.Keys = keys
}
err = storage.Purge(msg.Keys, msg.Type)
if err != nil {
this.replyFail(message.RequestId, "purge keys failed: "+err.Error())