From ce7062a422777c00aadf43ad67a90cc8aae689a5 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 2 Feb 2020 03:11:32 +0800 Subject: 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 --- custom/conf/app.ini.sample | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'custom') 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 -- cgit v1.2.3