diff --git a/server/routes.go b/server/routes.go index c5fd3293..af54cd17 100644 --- a/server/routes.go +++ b/server/routes.go @@ -1128,6 +1128,13 @@ func allowedHostsMiddleware(addr net.Addr) gin.HandlerFunc { } } +func CacheControlMiddleware() gin.HandlerFunc { + return func(c *gin.Context) { + c.Header("Cache-Control", "max-age=0") + c.Next() + } +} + func (s *Server) GenerateRoutes() http.Handler { config := cors.DefaultConfig() config.AllowWildcard = true @@ -1141,6 +1148,7 @@ func (s *Server) GenerateRoutes() http.Handler { r := gin.Default() r.Use( + CacheControlMiddleware(), cors.New(config), allowedHostsMiddleware(s.addr), )