Returns true if object should be excluded from cache
(bucket, object string)
| 521 | |
| 522 | // Returns true if object should be excluded from cache |
| 523 | func (c *cacheObjects) isCacheExclude(bucket, object string) bool { |
| 524 | // exclude directories from cache |
| 525 | if strings.HasSuffix(object, SlashSeparator) { |
| 526 | return true |
| 527 | } |
| 528 | for _, pattern := range c.exclude { |
| 529 | matchStr := fmt.Sprintf("%s/%s", bucket, object) |
| 530 | if ok := wildcard.MatchSimple(pattern, matchStr); ok { |
| 531 | return true |
| 532 | } |
| 533 | } |
| 534 | return false |
| 535 | } |
| 536 | |
| 537 | // choose a cache deterministically based on hash of bucket,object. The hash index is treated as |
| 538 | // a hint. In the event that the cache drive at hash index is offline, treat the list of cache drives |