Original link: https://wiki.eryajf.net/pages/8f3ba7/
When using go to write some small tools, if the sensitivity of the data is not so strong, then some hot data can be considered in the cache, and there is no need to use external services for the cache, then directly use the local memory for storage. Can. go-cache is a Go language library for local caching, which supports expiration time and automatic cleaning. It uses an internal goroutine to check whether cache entries are expired, and automatically cleans expired cache entries when needed. It allows us to easily put some data in the cache.
This article is transferred from: https://wiki.eryajf.net/pages/8f3ba7/
This site is only for collection, and the copyright belongs to the original author.