summaryrefslogtreecommitdiff
path: root/internal/api/client/fileserver/servefile.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/api/client/fileserver/servefile.go')
-rw-r--r--internal/api/client/fileserver/servefile.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/api/client/fileserver/servefile.go b/internal/api/client/fileserver/servefile.go
index ee2ff51ad..ac2fa7bc2 100644
--- a/internal/api/client/fileserver/servefile.go
+++ b/internal/api/client/fileserver/servefile.go
@@ -107,5 +107,11 @@ func (m *FileServer) ServeFile(c *gin.Context) {
return
}
- c.DataFromReader(http.StatusOK, content.ContentLength, format, content.Content, nil)
+ c.DataFromReader(http.StatusOK, content.ContentLength, format, content.Content, map[string]string{
+ // since we'll never host different files at the same
+ // URL (bc the ULIDs are generated per piece of media),
+ // it's sensible and safe to use a long cache here, so
+ // that clients don't keep fetching files over + over again
+ "Cache-Control": "max-age=604800",
+ })
}