restructured viewmodels, better serialization

This commit is contained in:
Simon Martens
2024-11-19 15:20:15 +01:00
parent 84fa6f7fa4
commit 7dc603df2c
26 changed files with 51479 additions and 198 deletions

View File

@@ -142,7 +142,8 @@ func (s *Server) Start() {
} else {
srv.Use(cache.New(cache.Config{
Next: func(c *fiber.Ctx) bool {
return c.Query("noCache") == "true"
// We do not cache error responses
return c.Query("noCache") == "true" || c.Response().StatusCode() != fiber.StatusOK
},
Expiration: 30 * time.Minute,
CacheControl: true,
@@ -153,6 +154,8 @@ func (s *Server) Start() {
srv.Use(STATIC_PREFIX, static(&views.StaticFS))
srv.Get("/:year?", controllers.GetYear(s.kgpz))
srv.Get("/:year/:issue/:page?", controllers.GetIssue(s.kgpz))
srv.Get("/:year/:issue/beilage/:subpage?", controllers.GetIssue(s.kgpz))
s.runner(srv)