(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性能(二):移除不用的视图引擎的更多相关文章

  1. 教你50招提升ASP.NET性能(二十六):对于开发人员的数据库性能技巧

    Database Performance Tips for Developers对于开发人员的数据库性能技巧 As a developer you may or may not need to go ...

  2. 教你50招提升ASP.NET性能(十六):把问题仍给硬件而不是开发人员

    (27)Throw hardware at the problem, not developers 招数27: 把问题仍给硬件而不是开发人员 As developers, we often want ...

  3. 教你50招提升ASP.NET性能(十一):避免在调试模式下运行网站

    (17)Avoid running sites in debug mode 招数17: 避免在调试模式下运行网站 When it comes to ASP.NET, one of the most c ...

  4. 教你50招提升ASP.NET性能(七):总是在服务器端执行验证

    (13)Always perform validation on the server as well 招数13: 总是在服务器端执行验证 This isn’t exactly a performan ...

  5. 教你50招提升ASP.NET性能(二十四):ORM小窍门

    ORM TipsORM小窍门 More and more people are using Object to Relational Mapping (ORM) tools to jump the d ...

  6. 教你50招提升ASP.NET性能(二十一):避免使用会话状态

    (39)Avoid using session state 招数39: 避免使用会话状态 Where possible, you should try and avoid using session ...

  7. 教你50招提升ASP.NET性能(二十):7条便利的ViewState技巧

    (32)Seven handy ViewState tips 招数32: 7条便利的ViewState技巧 Every time I have to deal with a classic ASP.N ...

  8. 教你50招提升ASP.NET性能(十九):静态集合

    (30)Static collections 招数30: 静态集合 If a collection is static, make sure it only contains the objects ...

  9. 教你50招提升ASP.NET性能(十八):在处理网站性能问题前,首先验证问题是否出在客户端

    (29)Before tackling any website performance issue, first verify the problem isn’t on the client 招数29 ...

随机推荐

  1. 安装universal-ctags

    universal-ctags是exuberant-ctags的替代者,相比gtags可以解析更多的语言,但是其他方面比如操作,数据库的组织方式等就不够好.需要自己编译安装 先用 git clone ...

  2. NFC(12)使用Android Beam技术传输文本数据及它是什么

    Android Beam技术是什么 Android Beam的基本理念就是两部(只能是1对1,不可像蓝牙那样1对多)NFC设备靠近时(一般是背靠背),通过触摸一部NFC设备的屏幕,将数据推向另外一部N ...

  3. COM, COM+ and .NET 的区别

    所有的优秀程序员都会尽自己的最大努力去使自己所写的程序具有更好的可重用性,因为它可以让你快速地写出更加健壮和可升级性的程序. 有两种使代码重用的选择: 1.白盒:最简单的一种,就是把你的程序片拷贝到另 ...

  4. wince下sources\sources.cmn\Makefile.def的相关作用

    1:首先是Makefile.def: ---------------------------------------- 在所有驱动的makefile中有!INCLUDE $(_MAKEENVROOT) ...

  5. wifi mode: AP,Client,Ad-hoc,802.11s,Pseudo Ad-hoc(ahdemo),Monitor,AP(WDS),Client(WDS)

    openwrt wifi mode:APClientAd-hoc802.11sPseudo Ad-hoc(ahdemo)MonitorAP(WDS)Client(WDS) http://forum.a ...

  6. Oracle Length 和 Lengthb 函数说明 .(用来判断记录值里是否有中文内容)

    一.官网的说明 http://download.oracle.com/docs/cd/E11882_01/server.112/e26088/functions088.htm#SQLRF00658 P ...

  7. xmlns 属性

    xmlns 属性 xmlns 属性可以在文档中定义一个或多个可供选择的命名空间.该属性可以放置在文档内任何元素的开始标签中.该属性的值类似于 URL,它定义了一个命名空间,浏览器会将此命名空间用于该属 ...

  8. 在Sql Server 查询分析器里使用事务

    declare @updatecount int begin TRAN DECLARE @tbid INTSELECT @tbid=iMax FROM tbID WHERE strName='ipcc ...

  9. myeclipse2015不能启动tomcat,提示: Several ports (8005, 8080, 8009) required by Tomcat v7.0 Server at local

    myeclipse2015不能启动tomcat,提示: Several ports (8005, 8080, 8009) required by Tomcat v7.0 Server at local ...

  10. tcxtreelist 展示图片 图像

    procedure TfrmstPostImageCollate.LoadCollateImage(AOrderID: integer);var mySql: string; node: TcxTre ...