From b410207dc1f624f9c14a90de97b22634667d762e Mon Sep 17 00:00:00 2001 From: Unknwon Date: Wed, 12 Aug 2015 04:58:39 +0800 Subject: [PATCH] add cache-control for attachments --- cmd/web.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/web.go b/cmd/web.go index 6ca771e2..62fb9187 100644 --- a/cmd/web.go +++ b/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 {