Redis is gaining traction in the .NET world, checkout the new Azure Redis Cache service
The code snippet horror
Till now embedding code snippets in a WordPress blog post was a painful process for me. I’ve tried several plugins but in the end all have a major downside when it comes to editing, I just couldn’t edit a single line of code because the original code block was transformed into HTML.
For a while I was using Live Writer, it was way better than fighting with TinyMCE, but code editing had the same downside, every time I wanted to make an edit, I had to paste the original snippet in Visual Studio, made the edit there and then override it in Live Writer. Another inconvenient for me with Live Writer was the preview feature that didn’t quite work with my WordPress theme. After I realize that posting from Live Writer makes it impossible to edit the post in WordPress editor because the code blocks loose padding, I’ve given up the Live Writer.
As a GitHub user I grow found of Markdown, it felt natural to document my projects with it but embedding gists in blog posts felt wrong. Making a gist for every snippet was messy, not to mention that it doesn’t work with RSS readers since the code blocks are not stored in the blog post content.
Calling ASP.NET Web API endpoints at regular intervals can be easily done using Windows Task Scheduler and PowerShell’s Invoke-RestMethod. The following script makes a GET call for each supplied endpoint, if a call fails then the endpoint’s URL and the error details are sent to Windows Application Event Log.
With MvcThrottle you can protect your site from aggressive crawlers, scraping tools or unwanted traffic spikes originated from the same location by limiting the rate of requests that a client from the same IP can make to your site or to specific routes. MvcThrottle is compatible with ASP.NET MVC 5.1 and can be installed via NuGet, the package is available at nuget.org/packages/MvcThrottle.
You can set multiple limits for different scenarios like allowing an IP to make a maximum number of calls per second, per minute, per hour or per day. You can define these limits to address all requests made to your website or you can scope the limits to each Controller, Action or URL, with or without query string params.
- - added per Week rate limit that can be used with Redis, Azure caching or any other caching service that can hold data more then 24h
- - added TracingThrottleLogger to publish throttling messages to the native web api ITraceWritter if one is supplied
- - allow override of throttle key computation ComputeThrottleKey
- - allow override of HTTP Status code when requests are rate limited
- - short-circut large control statements
- - move whitelist checking to separate method
- - use member ThrottlePolicy instead of passing it around
- - RequestIndentity renamed to RequestIdentity
ASP.NET Web API Throttling handler is designed to control the rate of requests that clients can make to a Web API based on IP address, client API key and request route. WebApiThrottle is compatible with Web API v2 and can be installed via NuGet, the package is available at nuget.org/packages/WebApiThrottle.
Web API throttling can be configured using the built-in
ThrottlePolicy. You can set multiple limits for different scenarios like allowing an IP or Client to make a maximum number of calls per second, per minute, per hour or even per day. You can define these limits to address all requests made to an API or you can scope the limits to each API route.
With the new App Suspend feature in IIS 8.5 you’ll get a 90% reduction in start-up time, this reason is enough for me to upgrade to Windows Server 2012 R2