Skip to content
  • Home
  • About
  • No Access
  • Privacy Policy
Bits of .NET
Bits of .NET
  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy

Tag: Fault Tolerance

Polly

Polly in .NET: Build Resilient Microservices with Retry, Circuit Breaker, and Timeout

- 22.08.26 | 22.08.26 - ErcanOPAK comment on Polly in .NET: Build Resilient Microservices with Retry, Circuit Breaker, and Timeout

🛡️ Key Takeaways: Handle transient failures gracefully with retries, circuit breakers, and timeouts. Make your microservices bulletproof against network issues. Network failures happen. Services go down. Polly makes your .NET applications resilient. 🚀 Quick Setup dotnet add package Polly dotnet add package Polly.Extensions.Http dotnet add package Microsoft.Extensions.Http.Polly // Program.cs – Configure retry policies using Polly; […]

Read More
Ajax

AJAX: Implement Exponential Backoff for Failed Requests

- 19.03.26 - ErcanOPAK comment on AJAX: Implement Exponential Backoff for Failed Requests

🔄 Handle Network Failures Gracefully Request fails. You retry immediately. Fails again. Server overwhelmed. Exponential backoff fixes this. The Pattern async function fetchWithRetry(url, options = {}, maxRetries = 3) { for (let i = 0; i = 500 || response.status === 429) { if (i === maxRetries) throw new Error(‘Max retries reached’); // Exponential backoff: […]

Read More
Ajax

AJAX: Use Retry Logic with Exponential Backoff for Failed Requests

- 21.02.26 - ErcanOPAK comment on AJAX: Use Retry Logic with Exponential Backoff for Failed Requests

Network failures happen. Retry with exponential backoff prevents overwhelming server while ensuring request eventually succeeds. Simple Retry Function: async function fetchWithRetry(url, options = {}, maxRetries = 3) { for (let i = 0; i setTimeout(resolve, delay)); } } } // Usage try { const data = await fetchWithRetry(‘/api/data’); console.log(await data.json()); } catch (error) { console.error(‘Failed […]

Read More
Asp.Net Core

.NET Core: Use Polly for Resilient HTTP Requests with Retry Logic

- 16.02.26 - ErcanOPAK comment on .NET Core: Use Polly for Resilient HTTP Requests with Retry Logic

Network failures happen. Polly adds retry, circuit breaker, and timeout policies automatically. Install: dotnet add package Polly dotnet add package Microsoft.Extensions.Http.Polly Add to HttpClient: // Program.cs builder.Services.AddHttpClient(“MyAPI”, client => { client.BaseAddress = new Uri(“https://api.example.com”); }) .AddTransientHttpErrorPolicy(policy => policy.WaitAndRetryAsync(3, attempt => TimeSpan.FromSeconds(Math.Pow(2, attempt))) ) .AddTransientHttpErrorPolicy(policy => policy.CircuitBreakerAsync(5, TimeSpan.FromMinutes(1)) ); Usage: public class MyService { private readonly […]

Read More
Ajax / JavaScript

Handle AJAX Errors Properly: Retry Logic with Exponential Backoff

- 01.02.26 | 01.02.26 - ErcanOPAK comment on Handle AJAX Errors Properly: Retry Logic with Exponential Backoff

Your AJAX calls fail randomly due to network hiccups or server load? Implement smart retry logic that actually works. The Problem with Basic Retry: // Bad: Immediate retry can make things worse function badRetry(url, maxAttempts) { for (let i = 0; i < maxAttempts; i++) { try { return await fetch(url); } catch (error) { […]

Read More
November 2026
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  
« Oct    

Most Viewed Posts

  • How to make theater mode the default for Youtube (1,055)
  • Get the User Name and Domain Name from an Email Address in SQL (981)
  • How to add default value for Entity Framework migrations for DateTime and Bool (977)
  • Get the First and Last Word from a String or Sentence in SQL (858)
  • How to select distinct rows in a datatable in C# (854)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (653)
  • Add Constraint to SQL Table to ensure email contains @ (609)
  • Average of all values in a column that are not zero in SQL (570)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (547)
  • Find numbers with more than two decimal places in SQL (475)

Recent Posts

  • C#: Fix a ConditionalWeakTable Entry Vanishing Too Soon
  • Docker: Fix a Stale COPY Layer After Editing .dockerignore
  • Photoshop: Fix a Pattern Overlay Scaling Wrong on a High-DPI File
  • SQL Server: Fix a Computed Column Index Skipped by Implicit Cast
  • HTML5: Fix a required Input Inside a Hidden Tab Blocking Submit
  • SQL Server: Fix ROW_NUMBER Ties Reordering Between Identical Runs
  • C#: Fix an Enum HasFlag Returning True for the Zero Value
  • WordPress: Fix Featured Images Vanishing After a CDN Migration
  • Photoshop: Fix Content-Aware Fill Smearing a Repeating Pattern
  • Asp.Net Core: Fix Antiforgery Tokens Rejected Behind a Reverse Proxy

Most Viewed Posts

  • How to make theater mode the default for Youtube (1,055)
  • Get the User Name and Domain Name from an Email Address in SQL (981)
  • How to add default value for Entity Framework migrations for DateTime and Bool (977)
  • Get the First and Last Word from a String or Sentence in SQL (858)
  • How to select distinct rows in a datatable in C# (854)

Recent Posts

  • C#: Fix a ConditionalWeakTable Entry Vanishing Too Soon
  • Docker: Fix a Stale COPY Layer After Editing .dockerignore
  • Photoshop: Fix a Pattern Overlay Scaling Wrong on a High-DPI File
  • SQL Server: Fix a Computed Column Index Skipped by Implicit Cast
  • HTML5: Fix a required Input Inside a Hidden Tab Blocking Submit

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com