Cache Settings for DEV mode

This commit is contained in:
Simon Martens
2025-05-21 14:02:05 +02:00
parent fca2b0dd5e
commit 86b25946eb
10 changed files with 756 additions and 18 deletions

View File

@@ -4,15 +4,16 @@ import (
"io/fs"
"net/http"
"github.com/Theodor-Springmann-Stiftung/lenz-web/helpers/middleware/filesystem"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"
)
func StaticHandler(fs *fs.FS) fiber.Handler {
func StaticHandler(fs *fs.FS, dev bool) fiber.Handler {
return filesystem.New(filesystem.Config{
Root: http.FS(*fs),
Browse: false,
Index: "index.html",
Dev: dev,
MaxAge: 3600,
})
}