gin-cache icon indicating copy to clipboard operation
gin-cache copied to clipboard

What's the difference of time duration between persist and cache?

Open rts-gordon opened this issue 2 years ago • 0 comments

Hi there There are two time duration of gin-cache: persist.NewMemoryStore(), cache.CacheByRequestURI, what's the difference between them? Can they merge into one time duration?

memoryStore := persist.NewMemoryStore(1 * time.Minute)
	app.GET("/hello",
		cache.CacheByRequestURI(memoryStore, 2*time.Second),
		func(c *gin.Context) {
			c.String(200, "hello world")
		},
	)

rts-gordon avatar Feb 11 '23 21:02 rts-gordon