aboutsummaryrefslogtreecommitdiff
path: root/cache.go
diff options
context:
space:
mode:
Diffstat (limited to 'cache.go')
-rw-r--r--cache.go22
1 files changed, 18 insertions, 4 deletions
diff --git a/cache.go b/cache.go
index 8f9781b..7259e38 100644
--- a/cache.go
+++ b/cache.go
@@ -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())
+ }
+}