summaryrefslogtreecommitdiffstats
path: root/custom/conf
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-02-02 03:11:32 +0800
committerGitHub <noreply@github.com>2020-02-01 19:11:32 +0000
commitce7062a422777c00aadf43ad67a90cc8aae689a5 (patch)
tree1648064ddb7f8d9e5c6b889bed9147db295cb658 /custom/conf
parent046bb05979b2476d4eef85f2d156ac42310f1a3f (diff)
downloadgitea-ce7062a422777c00aadf43ad67a90cc8aae689a5.tar.gz
gitea-ce7062a422777c00aadf43ad67a90cc8aae689a5.zip
Cache last commit to accelerate the repository directory page visit (#10069)
* Cache last commit to accelerate the repository directory page visit * Default use default cache configuration * add tests for last commit cache * Simplify last commit cache * Revert Enabled back * Change the last commit cache default ttl to 8760h * Fix test
Diffstat (limited to 'custom/conf')
-rw-r--r--custom/conf/app.ini.sample14
1 files changed, 13 insertions, 1 deletions
diff --git a/custom/conf/app.ini.sample b/custom/conf/app.ini.sample
index b0aafb8b31..31e8bf0b09 100644
--- a/custom/conf/app.ini.sample
+++ b/custom/conf/app.ini.sample
@@ -43,7 +43,7 @@ DEFAULT_CLOSE_ISSUES_VIA_COMMITS_IN_ANY_BRANCH = false
ENABLE_PUSH_CREATE_USER = false
ENABLE_PUSH_CREATE_ORG = false
; Comma separated list of globally disabled repo units. Allowed values: repo.issues, repo.ext_issues, repo.pulls, repo.wiki, repo.ext_wiki
-DISABLED_REPO_UNITS =
+DISABLED_REPO_UNITS =
; Comma separated list of default repo units. Allowed values: repo.code, repo.releases, repo.issues, repo.pulls, repo.wiki.
; Note: Code and Releases can currently not be deactivated. If you specify default repo units you should still list them for future compatibility.
; External wiki and issue tracker can't be enabled by default as it requires additional settings.
@@ -632,6 +632,8 @@ SENDMAIL_PATH = sendmail
SENDMAIL_ARGS =
[cache]
+; if the cache enabled
+ENABLED = true
; Either "memory", "redis", or "memcache", default is "memory"
ADAPTER = memory
; For "memory" only, GC interval in seconds, default is 60
@@ -644,6 +646,16 @@ HOST =
; Setting it to 0 disables caching
ITEM_TTL = 16h
+; Last commit cache
+[cache.last_commit]
+; if the cache enabled
+ENABLED = true
+; Time to keep items in cache if not used, default is 8760 hours.
+; Setting it to 0 disables caching
+ITEM_TTL = 8760h
+; Only enable the cache when repository's commits count great than
+COMMITS_COUNT = 1000
+
[session]
; Either "memory", "file", or "redis", default is "memory"
PROVIDER = memory