#cache Clear
Tags #utils #browser #performance #array #async #dom #objects #pattern #events #format #concurrency #http #ui #advanced #fetch #url #string #functional #cache #files #crypto #promise #intl #observer
JavaScript LocalStorage with Expiry
Extends localStorage with TTL (time-to-live) support. setItem stores a value alongside an expiry timestamp. getItem returns null and removes the key if the TTL has elapsed. Useful for caching API responses client-side, storing ephemeral UI state, and implementing remember-me tokens without a backend session.
JavaScript WeakRef Object Cache
A cache backed by WeakRef and FinalizationRegistry. Stored values are held weakly — the garbage collector can reclaim them if memory pressure is high, and the registry automatically cleans up stale entries from the internal map. Ideal for caching large objects (DOM nodes, rendered images) without causing memory leaks.