You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

13 lines
287 B

  1. package middleware
  2. import "github.com/gin-gonic/gin"
  3. func DisableCache() gin.HandlerFunc {
  4. return func(c *gin.Context) {
  5. c.Header("Cache-Control", "no-store, no-cache, must-revalidate, private, max-age=0")
  6. c.Header("Pragma", "no-cache")
  7. c.Header("Expires", "0")
  8. c.Next()
  9. }
  10. }