Generic performance improvement tips
Here are a couple of pointers to improve the overall application performance in an ASP.NET Core Web Application.
Avoiding the Response.Redirect method
When we want to do client-side redirection, developers can call the Response.Redirect
method with the URL passed as a parameter. But there is a small problem with this approach. If we use Response.Redirect
, the browser will send the request to the server again, which needs another round trip to the server. So, if possible, it is better to avoid the Response.Redirect
method and instead use RedirectToAction
method if possible.
Using string builder
If your application involves a lot of string manipulation, it is preferable to use string builder instead of the usual string concatenation. String concatenation results in creating a new string object for each of the operations, whereas string builder works on the single object itself. We can achieve significantly better performance when we use string builder in large...