summaryrefslogtreecommitdiffstats
path: root/modules/setting/setting.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-10-15 06:05:57 +0800
committerzeripath <art27@cantab.net>2019-10-14 23:05:57 +0100
commit0be992a1e26f61a182113266a2eb34f77b87f9b4 (patch)
treeb4fe2d2ccf4f7264c6e083375ec8cdf4a6ff5216 /modules/setting/setting.go
parentb6ef539ef46b728736764899a05be8236ca0c306 (diff)
downloadgitea-0be992a1e26f61a182113266a2eb34f77b87f9b4.tar.gz
gitea-0be992a1e26f61a182113266a2eb34f77b87f9b4.zip
Make static resouces web browser cache time customized on app.ini (#8442)
* make static resouces web browser cache time customized on app.ini * Update docs/content/doc/advanced/config-cheat-sheet.en-us.md Co-Authored-By: zeripath <art27@cantab.net> * Update custom/conf/app.ini.sample Co-Authored-By: Antoine GIRARD <sapk@users.noreply.github.com> * fix docs
Diffstat (limited to 'modules/setting/setting.go')
-rw-r--r--modules/setting/setting.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index 278ed4b107..629a89766f 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -87,6 +87,7 @@ var (
CertFile string
KeyFile string
StaticRootPath string
+ StaticCacheTime time.Duration
EnableGzip bool
LandingPageURL LandingPage
UnixSocketPermission uint32
@@ -607,6 +608,7 @@ func NewContext() {
OfflineMode = sec.Key("OFFLINE_MODE").MustBool()
DisableRouterLog = sec.Key("DISABLE_ROUTER_LOG").MustBool()
StaticRootPath = sec.Key("STATIC_ROOT_PATH").MustString(AppWorkPath)
+ StaticCacheTime = sec.Key("STATIC_CACHE_TIME").MustDuration(6 * time.Hour)
AppDataPath = sec.Key("APP_DATA_PATH").MustString(path.Join(AppWorkPath, "data"))
EnableGzip = sec.Key("ENABLE_GZIP").MustBool()
EnablePprof = sec.Key("ENABLE_PPROF").MustBool(false)