in-memory cache
A store in the program's memory that keeps recently fetched values so they can be reused without asking the original source again.
In more detail
Each entry usually has an expiry time, or TTL, after which it is refetched. Everything in it is lost when the program restarts.
Example
class MemoryCache<K, V> { private entries = new Map<K, CacheEntry<V>>(); }Related terms
- TTL — How long a stored item, such as a session, token or cache entry, stays valid before it expires.
- Map (collection) — A built-in JavaScript collection of key-value pairs where keys can be any value, including objects, kept in insertion order.
- in-memory — Kept only in the running program's memory rather than in a database or file, so it is fast but lost when the program stops.
Taught in
- Optional Properties, Readonly And Index Signatures — Production TypeScript
- Generic Interfaces, Classes And Type Aliases — Production TypeScript