MCPcopy Index your code
hub / github.com/cshum/imagor / newImageCache

Function newImageCache

processor/vipsprocessor/cache.go:17–23  ·  view source on GitHub ↗

newImageCache creates a new ristretto image cache with the given byte budget.

(maxCost int64)

Source from the content-addressed store, hash-verified

15
16// newImageCache creates a new ristretto image cache with the given byte budget.
17func 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).

Calls

no outgoing calls