1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

chore: minor performance improvements

This commit is contained in:
Ferdinand Mütsch
2021-12-20 16:41:50 +01:00
parent 80252ff701
commit e14f8c1463
3 changed files with 42 additions and 20 deletions

14
main.go
View File

@@ -247,14 +247,12 @@ func main() {
// https://github.com/golang/go/issues/43431
embeddedStatic, _ := fs.Sub(staticFiles, "static")
static := conf.ChooseFS("static", embeddedStatic)
fileServer := gzipped.FileServer(fsutils.NewExistsHttpFs(
fsutils.ExistsFS{
Fs: fsutils.NeuteredFileSystem{
Fs: static,
},
}),
)
fileServer := gzipped.FileServer(fsutils.NewExistsHttpFS(
fsutils.NewExistsFS(
fsutils.NeuteredFileSystem{
FS: static,
}).WithCache(!config.IsDev()),
))
router.PathPrefix("/contribute.json").Handler(fileServer)
router.PathPrefix("/assets").Handler(fileServer)