这是表演的最佳方法吗? [英] which is best approach as performce ?

查看:73
本文介绍了这是表演的最佳方法吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的页面上有bootstrap选项卡。它包含很多HTML和Ajax。这导致页面渲染缓慢。所以我需要对此进行优化。我有三个解决方案



1)使用UserControl:单击选项卡按钮时动态加载用户控件

2)server.trnasfer:make mulliple页面和调用来自server.trnasfer

3)respose.redirect:make mulliple页面并通过response.redirect调用



所以哪个是最好的方法吗?

I have bootstrap tab on my page .which contain lot of HTML and Ajax from . which causes page rendering slowly . So i need to optimize this. i have three solution

1)Use the UserControl : dynamically load user control when click the tab button
2) server.trnasfer : make mulliple page and call by for server.trnasfer
3) respose.redirect : make mulliple page and call by response.redirect

so which is best approach?

推荐答案

使用Server.Transfer,因为它保留了服务器资源并避免了不必要的往返服务器。它提高了效率,但是作为URL的折衷将保持一致。
Use Server.Transfer as it preserves server resources and avoids the unnecessary roundtrips to the server. It improves efficiency, but having trade offs as URL will remain consistent.


看看你是否需要一次性所有数据然后更好地做一个Ajax调用并将数据绑定到控件而不是很多Ajax调用。再次确保Ajax调用是异步的,否则会很慢。



识别瓶颈的最佳方法是查看Brower开发工具中的NET选项卡,看看哪个请求需要更多时间。然后,您可以优化该服务或Web方法。
See if you need all data at once then better to do one Ajax call and bind the data to the controls instead of many Ajax calls. Again make sure the Ajax calls are async otherwise it will be slow.

Best way to identify the bottle neck is to see the NET tab in developer tool of Brower to see which request is taking more time. Then you can optimize that service or web method.


这篇关于这是表演的最佳方法吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆