Documentation ¶
Overview ¶
Package lrucache provides a byte-size-limited implementation of httpcache.Cache that stores data in memory.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( PluginConfig = &lrucacheConfig{ done: make(chan struct{}), } )
Config ...
Functions ¶
This section is empty.
Types ¶
type LruCache ¶
LruCache is a thread-safe, in-memory httpcache.Cache that evicts the least recently used entries from memory when either MaxSize (in bytes) limit would be exceeded or (if set) the entries are older than MaxAge (in seconds). Use the New constructor to create one.
func New ¶
New creates an LruCache that will restrict itself to maxSize bytes of memory. If maxAge > 0, entries will also be expired after maxAge seconds.
func (*LruCache) Get ¶
Get returns the []byte representation of a cached response and a bool set to true if the key was found.
Directories ¶
Path | Synopsis |
---|---|
Package twotier provides a wrapper for two httpcache.Cache instances, allowing you to use both a small and fast cache for popular objects and fall back to a larger and slower cache for less popular ones.
|
Package twotier provides a wrapper for two httpcache.Cache instances, allowing you to use both a small and fast cache for popular objects and fall back to a larger and slower cache for less popular ones. |
Click to show internal directories.
Click to hide internal directories.