Improve Website Performance with Lowercase URLs #SEO

At work we are always seeking how to make our websites use fewer resources and perform better. One of the performance increase was found by having Lowercase URLs. From the testing done, it resulted that Lowercase URLs make an average performance improvement of 10%. A big improvement with minimal effort.

How do you make sure that all the URLs are in lowercase? In MVC ASP.Net, you just need to add 1 line of code.

 

If you are using .Net Framework 4.5.1, add the new available property, RouteCollection.LowercaseUrls. In the RouteConfig.cs add the following line of code:

routes.LowercaseUrls = true;

 

If you are not using .Net Framework whose version is less than 4.5.1, you have to make some extra effort. You need to download a seperate LowercaseRoutesMVC nuget from the next address: http://www.nuget.org/packages/LowercaseRoutesMVC/

 

Then in the RouteConfig.cs, change your route maps to use the new MapRouteLowercase method available as follows:

routes.MapRouteLowercase(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );

If you have any unusual suggestions for performance improvements, let me know in the comments. Happy Lowercasing!

Hello, nice to meet you

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Leave a Reply