An ETS-backed cache for compiled format patterns.
Number format metadata and datetime format tokens are cached here after first compilation. A built-in sweeper periodically evicts random entries when the cache exceeds its configured maximum size.
The maximum number of entries defaults to 2,000 and can be overridden with:
config :localize, :format_cache_max_entries, 5_000
Summary
Functions
Returns a specification to start this module under a supervisor.
Look up a compiled format pattern by its cache key.
Store a compiled format pattern in the cache.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Look up a compiled format pattern by its cache key.
Arguments
keyis the cache key, typically a tuple like{:localize, :number_format_meta, format_string}.
Returns
{:ok, value}if the key is present.:missif not cached or the table does not exist.
Store a compiled format pattern in the cache.
Arguments
keyis the cache key.valueis the compiled artifact to cache.
Returns
:ok.