performance - ASP.NET MVC Routing - Thousands of URL's -
My ecommerce application stores the URL for the item pages in the database. There are thousands of these URLs, all of which are root level (i.e. domain-name.com/{item-page-url}).
If I add all of these URLs to the root table, then RouteColon for displaying each URL site. Why? The reason for this is
How should I manage this situation properly? Adding all the routes in the route table does not look right (much does not confirm it to mention the performance). I have seen some ideas about inspecting all the incoming URLs and then trying to match in the URL database, but I do not fully understand how I should apply it, nor am I sure This is the best way.
Any thoughts or suggestions? It seems that it will not be so unusual, but I have not found a concrete way to handle it.
If you set your path to mycreativeshop.com/product/my-product-name , adding the following paths at the top of your root config file can help you. and parameter value with the name of your product name in the action map and but above,
routes MapRoute ("CustomRouteProduct", "Product / {ID}", new {controller = "yourcontrollername", verb = "index"});
change the public workflow index (string id) {// var prdName = id ("-", ""); // View the prdName in database return (see); } Added
routes.MapRoute ("CustomRouteProductZX", "{id } ", New {controller =" content ", verb =" index "}); Accessing the
http: // localhost: 12025 / car-paint , I was directed to the content controller's index action where I was given the " In the car-paint "parameter id
http: // localhost: 12025 / home / (home one here Is also considered as a product)
Comments
Post a Comment