Documentation ¶
Overview ¶
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.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TwoTier ¶
type TwoTier struct {
// contains filtered or unexported fields
}
TwoTier creates a two-tiered cache out of two httpcache.Cache instances. Reads are favored from first, and writes affect both first and second.
func New ¶
func New(first httpcache.Cache, second httpcache.Cache) *TwoTier
New creates a TwoTier. Both first and second must be non-nil.
func (*TwoTier) Delete ¶
Delete removes the value associated with a key from both the first and second tier caches.
Click to show internal directories.
Click to hide internal directories.