fix: no cache middleware to prevent visual bugs

This commit is contained in:
httpjamesm
2022-12-28 14:14:30 -05:00
parent 7ec73f8af8
commit f9025ff9cc
3 changed files with 14 additions and 1 deletions
+12
View File
@@ -0,0 +1,12 @@
package middleware
import "github.com/gin-gonic/gin"
func NoCacheMiddleware() gin.HandlerFunc {
return func(c *gin.Context) {
c.Header("Cache-Control", "no-cache, no-store, must-revalidate")
c.Header("Pragma", "no-cache")
c.Header("Expires", "0")
c.Next()
}
}