Quick Answer
Distributed caching with Redis: IDistributedCache interface injected, backed by Redis. cache.GetStringAsync(key), SetStringAsync(key, value, options). Set TTL with DistributedCacheEntryOptions. Use for: session state, frequently read but rarely changing data, pre-computed responses. IMemoryCache is per-server (lost on restart, not shared in scaled apps). Redis is shared across all instances.
Answer
Use:
Redis
SQL Server distributed cache
Memcached
Useful for multi-instance API deployments.
S
SugharaIQ Editorial Team
Verified Answer
This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.