mirror of
https://git.vectorsigma.ru/public/photoview.git
synced 2026-08-03 20:59:03 +00:00
Setup cache headers for photo routes
This commit is contained in:
@@ -103,6 +103,9 @@ func RegisterPhotoRoutes(db *sql.DB, router *mux.Router) {
|
||||
w.Header().Set("Content-Length", fmt.Sprintf("%d", stats.Size()))
|
||||
}
|
||||
|
||||
// Allow caching the resource for 1 day
|
||||
w.Header().Set("Cache-Control", "private, max-age=86400, immutable")
|
||||
|
||||
io.Copy(w, file)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user