An extremely fast in-memory cache store that evicts keys on a first-in-first-out basis.
This cache store is useful for caching rendered component fragments and attribute strings to improve performance in production environments.
Example
defmodule MyComponent do
use Phlex.HTML
defp cache_store do
Phlex.FIFOCacheStore.new(max_bytesize: 1_048_576) # 1MB
end
end
Summary
Functions
Returns the current size of the cache in bytes.
Clears all entries from the cache.
Fetches a value from the cache, or executes the function and caches the result.
Creates a new FIFO cache store.
Returns the number of entries in the cache.
Functions
Returns the current size of the cache in bytes.
Clears all entries from the cache.
Fetches a value from the cache, or executes the function and caches the result.
Creates a new FIFO cache store.
Options
:max_bytesize- Maximum total size in bytes (default: 1MB)
Returns the number of entries in the cache.