I am working with Attribute Routing in asp.net mvc 4 web application. It is a single application that supports 15 different cultures and 20+ languages. The result of this, my routing table is extremely large, over 3000 routes. The main reason for so many routes is because the routes are localized per language. The follow on effect of this is that it results in a slow route lookup and in turn poor performance of the site.
I am looking at ways to improve performance. So looking for tips. Unfortunately I can't alter my routing structure due to business restrictions. The main reason I have so many routes is due to translations - there is an entry in the routing table for each language. Any way to avoid this?
Also, I note in the routing table, entries for POST methods - is this required? Can it be avoided to have entries in routing table for POST's?
Is there any form of caching that can be included to avoid routing table lookup and instead read from memory?
Any performance optimization tips of Attribute Routing or with routing in general would be excellent.
This is a complicated question, as no one clearly knows how complicated your route table is and what business restrictions you are facing when re-organize your web application. So what I can do is prompting some options for you to explore:
The suggestions above can be based on locale or language. For example, when you visit www.apple.com, you can find their local website like Canada or Italy are set up like virtual directory "www.apple.com/ca" or "www.apple.com/it".
Hope this helps! Henry
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With