How do you implement rate limiting in ASP.NET Core?
ASP.NET Core provides rate-limiting middleware with fixed-window, sliding-window, token-bucket, and concurrency limiters depending on target version. Parti
The question library
Explore practical questions, clear explanations, and code examples across developer technologies.
Showing 1117–1128 of 3610 questions
ASP.NET Core provides rate-limiting middleware with fixed-window, sliding-window, token-bucket, and concurrency limiters depending on target version. Parti
Define cache keys, TTLs, invalidation triggers, and acceptable staleness. Update durable state first and invalidate or refresh affected keys; use versionin
A circuit breaker temporarily blocks calls to a failing dependency after a threshold, allows a limited recovery probe, and closes when the dependency recov
Bulkheads isolate workloads so a slow or failing dependency does not exhaust resources needed by unrelated work. Isolation can use separate concurrency lim
Symptoms can include rising latency, low throughput, and many queued work items. Common causes include sync-over-async, blocking I/O, excessive locks, or u
Avoid blocking on Task with .Wait() or .Result, keep lock scopes short, never await inside a C# lock, and use SemaphoreSlim when asynchronous mutual exclus
Project only needed columns, use no-tracking queries for read-only data, index predicates, avoid N+1 patterns, limit result sets, and inspect generated SQL
EF Core compiled queries cache a compiled query delegate for repeated query shapes. They can help hot paths, but normal query caching already handles many
Generate and review migration scripts, test against representative data, apply through a controlled deployment identity, and use expand-and-contract change
IHostedService and BackgroundService run hosted work. Use bounded queues or a durable job system for important jobs, create DI scopes for scoped services,
On shutdown, stop accepting new work, signal cancellation, allow bounded time for in-flight requests/jobs to finish, and release resources. Hosted services
OpenTelemetry provides vendor-neutral instrumentation and export for distributed traces, metrics, and logs. Trace context links work across HTTP and messag