aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorshlande <shlandeme@gmail.com>2022-06-09 09:48:03 +0800
committerGitHub <noreply@github.com>2022-06-09 09:48:03 +0800
commit318fb2576178a56589c791e122aa871b155d16ae (patch)
tree74dfcdcf4f49057ea0f9908ef0db1957d2d95eb1 /internal
parent577621d463cb03787cb347e688c0aca1eca6b322 (diff)
web: enable `ETag` to improve loading speed of static resources (#7035)
Co-authored-by: shlande <shlandeme@icloud.com>
Diffstat (limited to 'internal')
-rw-r--r--internal/cmd/web.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/cmd/web.go b/internal/cmd/web.go
index 4356d5b8..42e4e065 100644
--- a/internal/cmd/web.go
+++ b/internal/cmd/web.go
@@ -89,6 +89,7 @@ func newMacaron() *macaron.Macaron {
m.Use(macaron.Static(
filepath.Join(conf.WorkDir(), "public"),
macaron.StaticOptions{
+ ETag: true,
SkipLogging: conf.Server.DisableRouterLog,
FileSystem: publicFs,
},
@@ -97,6 +98,7 @@ func newMacaron() *macaron.Macaron {
m.Use(macaron.Static(
conf.Picture.AvatarUploadPath,
macaron.StaticOptions{
+ ETag: true,
Prefix: db.USER_AVATAR_URL_PREFIX,
SkipLogging: conf.Server.DisableRouterLog,
},
@@ -104,6 +106,7 @@ func newMacaron() *macaron.Macaron {
m.Use(macaron.Static(
conf.Picture.RepositoryAvatarUploadPath,
macaron.StaticOptions{
+ ETag: true,
Prefix: db.REPO_AVATAR_URL_PREFIX,
SkipLogging: conf.Server.DisableRouterLog,
},