Skip to content

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: Rate Limiting

Asp.Net Core

.NET Core: Use Rate Limiting to Prevent API Abuse

- 15.02.26 - ErcanOPAK comment on .NET Core: Use Rate Limiting to Prevent API Abuse

APIs getting hammered with requests? .NET 7+ has built-in rate limiting middleware. Setup: // Program.cs builder.Services.AddRateLimiter(options => { options.AddFixedWindowLimiter(“fixed”, opt => { opt.Window = TimeSpan.FromMinutes(1); opt.PermitLimit = 100; // 100 requests per minute opt.QueueLimit = 0; }); }); var app = builder.Build(); app.UseRateLimiter(); Apply to Endpoints: app.MapGet(“/api/data”, () => “Data”) .RequireRateLimiting(“fixed”); // If user exceeds […]

Read More
Wordpress

WordPress: Limit Login Attempts Without Plugins Using .htaccess

- 03.02.26 - ErcanOPAK comment on WordPress: Limit Login Attempts Without Plugins Using .htaccess

Brute force bots hammering wp-login.php with 1000s of password attempts? Block them at Apache level before they even reach WordPress. The Plugin-Free Solution: Add to .htaccess in WordPress root: # Limit wp-login.php access to specific IPs <Files wp-login.php> Order Deny,Allow Deny from all Allow from YOUR_IP_ADDRESS Allow from YOUR_OFFICE_IP </Files> Replace YOUR_IP_ADDRESS with your actual […]

Read More
JavaScript

Debounce vs Throttle in JavaScript: When to Use Which (With Real Examples)

- 01.02.26 | 01.02.26 - ErcanOPAK comment on Debounce vs Throttle in JavaScript: When to Use Which (With Real Examples)

Search inputs lagging? Scroll events killing performance? Understanding debounce vs throttle is critical for responsive UIs. Debounce – Wait Until User Stops: function debounce(func, delay) { let timeoutId; return function(…args) { clearTimeout(timeoutId); timeoutId = setTimeout(() => { func.apply(this, args); }, delay); }; } // Usage: Search input const searchInput = document.getElementById(‘search’); const performSearch = debounce((query) […]

Read More
February 2026
M T W T F S S
 1
2345678
9101112131415
16171819202122
232425262728  
« Jan    

Most Viewed Posts

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

Recent Posts

  • C#: Use MemoryPack for 10x Faster Serialization than JSON
  • C#: Use params ReadOnlySpan for Allocation-Free Variable Arguments
  • C#: Use ObjectPool for Reusing Expensive Objects
  • C#: Use Lazy for Expensive Object Initialization
  • SQL: Use STRING_AGG to Concatenate Rows into Comma-Separated List
  • SQL: Use Filtered Indexes to Index Only Subset of Rows
  • .NET Core: Use Result Pattern to Avoid Exceptions for Expected Errors
  • .NET Core: Use IOptions Pattern for Strongly-Typed Configuration
  • Git: Use .gitattributes to Handle Line Endings Across OS
  • Git: Use git notes to Add Comments to Commits Without Changing History

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (935)
  • How to add default value for Entity Framework migrations for DateTime and Bool (832)
  • Get the First and Last Word from a String or Sentence in SQL (826)
  • How to select distinct rows in a datatable in C# (799)
  • How to make theater mode the default for Youtube (717)

Recent Posts

  • C#: Use MemoryPack for 10x Faster Serialization than JSON
  • C#: Use params ReadOnlySpan for Allocation-Free Variable Arguments
  • C#: Use ObjectPool for Reusing Expensive Objects
  • C#: Use Lazy for Expensive Object Initialization
  • SQL: Use STRING_AGG to Concatenate Rows into Comma-Separated List

Social

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