Brief analysis of the use of go-cache package

Original link:


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:
This site is only for collection, and the copyright belongs to the original author.