教你50招提升ASP.NET性能(二):移除不用的视图引擎
(2)Remove unused View Engines
招数2:
移除不用的视图引擎
If you're an ASP.NET MVC developer, you might not know that ASP.NET still loads the View Engines for both Razor and Web Forms by default. This can cause performance issues because MVC will normally look for Web Forms views first, before switching over to the Razor views if it can’t find them.
如果你是ASP.NET MVC开发人员,你可能不知道ASP.NET会默认加载Razor和Web Forms两种视图引擎。这可能引起性能问题,因为MVC总是会首先查找Web Forms视图,在不能找到它们的时候才会转向Razor 视图。
You can quickly eliminate this performance issue by adding the following two lines to your Global.asax, in the Application_Start():
你可以在Global.asax,Application_Start()添加下面的两行代码很快地排除这个性能问题
ViewEngines.Engines.Clear();
ViewEngines.Engines.Add(newRazorViewEngine());
Goodbye Web Forms View Engine!
再见Web Forms视图引擎!
教你50招提升ASP.NET性能(二):移除不用的视图引擎的更多相关文章
- 教你50招提升ASP.NET性能(二十六):对于开发人员的数据库性能技巧
Database Performance Tips for Developers对于开发人员的数据库性能技巧 As a developer you may or may not need to go ...
- 教你50招提升ASP.NET性能(十六):把问题仍给硬件而不是开发人员
(27)Throw hardware at the problem, not developers 招数27: 把问题仍给硬件而不是开发人员 As developers, we often want ...
- 教你50招提升ASP.NET性能(十一):避免在调试模式下运行网站
(17)Avoid running sites in debug mode 招数17: 避免在调试模式下运行网站 When it comes to ASP.NET, one of the most c ...
- 教你50招提升ASP.NET性能(七):总是在服务器端执行验证
(13)Always perform validation on the server as well 招数13: 总是在服务器端执行验证 This isn’t exactly a performan ...
- 教你50招提升ASP.NET性能(二十四):ORM小窍门
ORM TipsORM小窍门 More and more people are using Object to Relational Mapping (ORM) tools to jump the d ...
- 教你50招提升ASP.NET性能(二十一):避免使用会话状态
(39)Avoid using session state 招数39: 避免使用会话状态 Where possible, you should try and avoid using session ...
- 教你50招提升ASP.NET性能(二十):7条便利的ViewState技巧
(32)Seven handy ViewState tips 招数32: 7条便利的ViewState技巧 Every time I have to deal with a classic ASP.N ...
- 教你50招提升ASP.NET性能(十九):静态集合
(30)Static collections 招数30: 静态集合 If a collection is static, make sure it only contains the objects ...
- 教你50招提升ASP.NET性能(十八):在处理网站性能问题前,首先验证问题是否出在客户端
(29)Before tackling any website performance issue, first verify the problem isn’t on the client 招数29 ...
随机推荐
- 驱动之路-platform简例按键驱动☆☆☆
一 .重要知识点: ▉1.platform设备模型 从Linux 2.6起引入了一套新的驱动管理和注册机制,platform_device和platform_driver,Linux中大部分的设备驱动 ...
- MarshalByRefObject浅析
首先了解一下不同应用程序域中的对象的通信方式有两种: 一种是跨应用程序域边界传输对象副本 一种是使用代理交换消息. 简单来讲,继承此类的对象可以跨越应用程序域边界被引用,甚至被远程引用. 当一个对象需 ...
- Linux SocketCan client server demo hacking
/*********************************************************************** * Linux SocketCan client se ...
- I.MX6 android BatteryService jni hacking
/**************************************************************************** * I.MX6 android Batter ...
- Windows安装weblogic
WebLogic安装结束 以下是进入MyEclipse启动配置WebLogic
- 普通文件迁移ASM
1.ASM Access Through FTP and HTML Using XDB Configuration 2.rman 3.dbms_file_transfer 4.11g asmcmd 利 ...
- ORACLE SQLloader详细语法
Oracle SQL Loader的详细语法 SQL*LOADER是ORACLE的数据加载工具,通常用来将操作系统文件迁移到ORACLE数据库中.SQL*LOADER是大型数据 ...
- 多线程程序设计学习(12)Thread-soecific storage pattern
Thread-Specific-Storage[线程保管箱] 一:Thread-Specific Storage的参与者--->记录日志的线程(ClientThread)--->负责获取不 ...
- WCF SOA --- AJAX 跨域请求处理 CORS for WCF
一.问题 跨域请求无法处理的问题,由于为了阻止恶意的网站通过JS脚本来窃取正常网站受保护的资源.所由所有的浏览器的默认策略是阻止XmlHttpRequest的跨域的异步请求. 但是对于一 ...
- javscript面试题(一)
你如何理解HTML结构的语意化? 1.去掉或样式丢失的时候能让页面呈现清晰的结构:2.屏幕阅读器(如果访客有视障)会完全根据你的标记来“读”你的网页:3.PDA.手机等设备可能无法像普通电脑的浏览器一 ...