# `Electric.Client.ExpiredShapesCache`
[🔗](https://github.com/electric-sql/electric/tree/%40core/elixir-client%400.10.2/packages/elixir-client/lib/electric/client/expired_shapes_cache.ex#L1)

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.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `clear`

```elixir
@spec clear() :: :ok
```

Clear all entries from the cache.

# `clear_handle`

```elixir
@spec clear_handle(String.t()) :: :ok
```

Clear the expired handle for a single shape key.

# `get_expired_handle`

```elixir
@spec get_expired_handle(String.t()) :: String.t() | nil
```

Get the expired handle for a shape key, if one exists.

Updates the last_used timestamp to maintain LRU ordering.

# `mark_expired`

```elixir
@spec mark_expired(String.t(), String.t()) :: :ok
```

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.

# `size`

```elixir
@spec size() :: non_neg_integer()
```

Get the current number of entries in the cache.

Primarily for testing purposes.

# `start_link`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
