diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-10-15 06:05:57 +0800 |
---|---|---|
committer | zeripath <art27@cantab.net> | 2019-10-14 23:05:57 +0100 |
commit | 0be992a1e26f61a182113266a2eb34f77b87f9b4 (patch) | |
tree | b4fe2d2ccf4f7264c6e083375ec8cdf4a6ff5216 /routers/routes | |
parent | b6ef539ef46b728736764899a05be8236ca0c306 (diff) | |
download | gitea-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 'routers/routes')
-rw-r--r-- | routers/routes/routes.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 8dfcdb9c9b..0db0af43f0 100644 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -139,14 +139,14 @@ func NewMacaron() *macaron.Macaron { m.Use(public.Custom( &public.Options{ SkipLogging: setting.DisableRouterLog, - ExpiresAfter: time.Hour * 6, + ExpiresAfter: setting.StaticCacheTime, }, )) m.Use(public.Static( &public.Options{ Directory: path.Join(setting.StaticRootPath, "public"), SkipLogging: setting.DisableRouterLog, - ExpiresAfter: time.Hour * 6, + ExpiresAfter: setting.StaticCacheTime, }, )) m.Use(public.StaticHandler( @@ -154,7 +154,7 @@ func NewMacaron() *macaron.Macaron { &public.Options{ Prefix: "avatars", SkipLogging: setting.DisableRouterLog, - ExpiresAfter: time.Hour * 6, + ExpiresAfter: setting.StaticCacheTime, }, )) m.Use(public.StaticHandler( @@ -162,7 +162,7 @@ func NewMacaron() *macaron.Macaron { &public.Options{ Prefix: "repo-avatars", SkipLogging: setting.DisableRouterLog, - ExpiresAfter: time.Hour * 6, + ExpiresAfter: setting.StaticCacheTime, }, )) |