12 lines
242 B
Go
12 lines
242 B
Go
|
package middleware
|
||
|
|
||
|
import "github.com/gin-gonic/gin"
|
||
|
|
||
|
func CacheMiddleware() gin.HandlerFunc {
|
||
|
return func(c *gin.Context) {
|
||
|
c.Writer.Header().Set("Cache-Control", "no-cache")
|
||
|
c.Writer.Header().Set("Pragma", "no-cache")
|
||
|
c.Next()
|
||
|
}
|
||
|
}
|