mirror of
https://github.com/willnorris/imageproxy.git
synced 2024-12-30 22:34:18 -05:00
cmd: use trie for caching files on disk (fixes #50)
This commit is contained in:
parent
11370ac826
commit
355a00f7b6
1 changed files with 3 additions and 0 deletions
|
@ -135,6 +135,9 @@ func diskCache(path string) *diskcache.Cache {
|
|||
d := diskv.New(diskv.Options{
|
||||
BasePath: path,
|
||||
CacheSizeMax: *cacheSize * 1024 * 1024,
|
||||
|
||||
// For file "c0ffee", store file as "c0/ff/c0ffee"
|
||||
Transform: func(s string) []string { return []string{s[0:2], s[2:4]} },
|
||||
})
|
||||
return diskcache.NewWithDiskv(d)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue