pages-server/server/upstream/const.go

22 lines
1.0 KiB
Go
Raw Normal View History

2021-12-05 14:47:33 +01:00
package upstream
import "time"
2021-12-05 16:24:26 +01:00
// defaultBranchCacheTimeout specifies the timeout for the default branch cache. It can be quite long.
var defaultBranchCacheTimeout = 15 * time.Minute
2021-12-05 14:47:33 +01:00
2021-12-05 16:24:26 +01:00
// branchExistenceCacheTimeout specifies the timeout for the branch timestamp & existence cache. It should be shorter
// than fileCacheTimeout, as that gets invalidated if the branch timestamp has changed. That way, repo changes will be
2021-12-05 14:47:33 +01:00
// picked up faster, while still allowing the content to be cached longer if nothing changes.
2021-12-05 16:24:26 +01:00
var branchExistenceCacheTimeout = 5 * time.Minute
2021-12-05 14:47:33 +01:00
2021-12-05 16:24:26 +01:00
// fileCacheTimeout specifies the timeout for the file content cache - you might want to make this quite long, depending
2021-12-05 14:47:33 +01:00
// on your available memory.
2021-12-05 16:24:26 +01:00
var fileCacheTimeout = 5 * time.Minute
2021-12-05 14:47:33 +01:00
2021-12-05 16:24:26 +01:00
// fileCacheSizeLimit limits the maximum file size that will be cached, and is set to 1 MB by default.
var fileCacheSizeLimit = 1024 * 1024
2021-12-05 15:21:05 +01:00
2021-12-05 16:24:26 +01:00
// canonicalDomainCacheTimeout specifies the timeout for the canonical domain cache.
var canonicalDomainCacheTimeout = 15 * time.Minute