Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
cache
✓ github.com/chenyahui/gin-cache
Caching a Gin route with in-memory store
package main
import (
"github.com/gin-gonic/gin"
"github.com/chenyahui/gin-cache"
"github.com/chenyahui/gin-cache/persist"
)
func main() {
r := gin.Default()
store := persist.NewMemoryStore(60)
r.GET("/hello", cache.CacheByRequestURI(store, 10*time.Second), func(c *gin.Context) {
c.String(200, "Hello, World!")
})
r.Run()
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
1.10.0latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.