13 lines
272 B
Go
13 lines
272 B
Go
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()
|
|
}
|
|
}
|