diff options
author | Runxi Yu <me@runxiyu.org> | 2025-03-25 02:54:07 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-03-25 02:54:07 +0800 |
commit | 06b1396b96dbefb4ab6c01b5d34b2150e1721165 (patch) | |
tree | fab751158768a67a0101d2eeb39717996e676ae8 /cache.go | |
parent | Cache dir view in tree view (diff) | |
download | forge-06b1396b96dbefb4ab6c01b5d34b2150e1721165.tar.gz forge-06b1396b96dbefb4ab6c01b5d34b2150e1721165.tar.zst forge-06b1396b96dbefb4ab6c01b5d34b2150e1721165.zip |
Cache file view
Diffstat (limited to 'cache.go')
-rw-r--r-- | cache.go | 22 |
1 files changed, 18 insertions, 4 deletions
@@ -23,8 +23,8 @@ func init() { var err error treeReadmeCache, err = ristretto.NewCache(&ristretto.Config[[]byte, treeReadmeCacheEntry]{ NumCounters: 1e4, - MaxCost: 1 << 30, - BufferItems: 64, + MaxCost: 1 << 60, + BufferItems: 8192, }) if err != nil { clog.Fatal(1, "Error initializing indexPageCache: "+err.Error()) @@ -37,10 +37,24 @@ func init() { var err error indexCommitsDisplayCache, err = ristretto.NewCache(&ristretto.Config[[]byte, []commitDisplay]{ NumCounters: 1e4, - MaxCost: 1 << 30, - BufferItems: 64, + MaxCost: 1 << 60, + BufferItems: 8192, }) if err != nil { clog.Fatal(1, "Error initializing indexCommitsCache: "+err.Error()) } } + +var commitPathFileHTMLCache *ristretto.Cache[[]byte, template.HTML] + +func init() { + var err error + commitPathFileHTMLCache, err = ristretto.NewCache(&ristretto.Config[[]byte, template.HTML]{ + NumCounters: 1e4, + MaxCost: 1 << 60, + BufferItems: 8192, + }) + if err != nil { + clog.Fatal(1, "Error initializing commitPathFileHTMLCache: "+err.Error()) + } +} |