diff --git a/pkg/api/souin.go b/pkg/api/souin.go index c57393d4d..a14671b2a 100644 --- a/pkg/api/souin.go +++ b/pkg/api/souin.go @@ -105,8 +105,13 @@ func (s *SouinAPI) BulkDelete(key string, purge bool) { // Delete will delete a record into the provider cache system and will update the Souin API if enabled // The key can be a regexp to delete multiple items func (s *SouinAPI) Delete(key string) { + _, err := regexp.Compile(key) for _, current := range s.storers { - current.Delete(key) + if err != nil { + current.DeleteMany(key) + } else { + current.Delete(key) + } } }