gin-cache
gin-cache copied to clipboard
feat: Option to extend cache time on cache hit
Hi,
Thanks for this package, works nicely.
Would it be possible to get an Option to extend the cache duration on a cache hit?
Thanks
This feature is more appropriate to implement in CacheStore.
For local memory cache store, ttlcache support to extend the cache duration on cache hit. But the default constructor disable the feature, You can open it yourself. https://github.com/chenyahui/gin-cache/blob/main/persist/memory.go#L22
For redis cache store, I will add a cache hit option for this demands later ~