我的网站在其索引页面中有很多菜单和子菜单,这些子菜单是从 db 加载的。Ajax 用于加载子菜单。因此,加载整个页面需要花费大量时间。我将如何减少加载时间。我正在使用 asp.net mvc3 和 sql server 2008 数据库
问问题
91 次
2 回答
0
There are many things that could be going wrong and causing your application to run slowly.
I’d recommend you turn the trace feature on because that will tell you what may be wrong. As Dimitar Dimitrov already mentioned you can try to cache the query in some way so you don’t have to retrieve it every time.
Another option would be to optimize the query so that it fetches all menus and submenus in one query.
But again, don’t do anything specifically until you’ve profiled your application to see where specifically is the issue.
于 2013-04-15T09:00:24.710 回答