newImageCache creates a new ristretto image cache with the given byte budget.
(maxCost int64)
| 15 | |
| 16 | // newImageCache creates a new ristretto image cache with the given byte budget. |
| 17 | func newImageCache(maxCost int64) (*imageCache, error) { |
| 18 | return ristretto.NewCache[string, *imagor.Blob](&ristretto.Config[string, *imagor.Blob]{ |
| 19 | NumCounters: 10000, |
| 20 | MaxCost: maxCost, |
| 21 | BufferItems: 64, |
| 22 | }) |
| 23 | } |
| 24 | |
| 25 | // loadOrCacheResult is the singleflight result for loadOrCache. |
| 26 | // memBlob is non-nil for static images (cached pixels or compressed bytes). |
no outgoing calls