LRU cache for tracking expired shape handles.
This cache stores shape handles that have been marked as expired (typically after receiving a 409 response). When making subsequent requests for the same shape, the client includes the expired handle as a query parameter to help bypass stale CDN/proxy caches.
The cache uses ETS for fast concurrent reads and a GenServer to manage LRU eviction when the cache exceeds the maximum number of entries.
Summary
Functions
Returns a specification to start this module under a supervisor.
Clear all entries from the cache.
Clear the expired handle for a single shape key.
Get the expired handle for a shape key, if one exists.
Mark a shape handle as expired for the given shape key.
Get the current number of entries in the cache.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec clear() :: :ok
Clear all entries from the cache.
@spec clear_handle(String.t()) :: :ok
Clear the expired handle for a single shape key.
Get the expired handle for a shape key, if one exists.
Updates the last_used timestamp to maintain LRU ordering.
Mark a shape handle as expired for the given shape key.
If the cache exceeds the maximum number of entries, the least recently used entry will be evicted.
@spec size() :: non_neg_integer()
Get the current number of entries in the cache.
Primarily for testing purposes.