Просмотр исходного кода

add cache-control for attachments

Unknwon 9 лет назад
Родитель
Сommit
b410207dc1
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      cmd/web.go

+ 1 - 0
cmd/web.go

@@ -345,6 +345,7 @@ func runWeb(ctx *cli.Context) {
 			}
 			defer fr.Close()
 
+			ctx.Header().Set("Cache-Control", "public,max-age=86400")
 			// Fix #312. Attachments with , in their name are not handled correctly by Google Chrome.
 			// We must put the name in " manually.
 			if err = repo.ServeData(ctx, "\""+attach.Name+"\"", fr); err != nil {