forked from forgejo/forgejo
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
This commit is contained in:
parent
b6ef539ef4
commit
0be992a1e2
5 changed files with 10 additions and 4 deletions
|
@ -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,
|
||||
},
|
||||
))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue