(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. Monitor vs WaitHandle

    http://stackoverflow.com/questions/1355398/monitor-vs-waithandle-based-thread-sync A problem with Mo ...

  2. git设置忽略某些文件或文件夹

    在git中如果想忽略掉某个文件,不让这个文件提交到版本库中,可以使用修改 .gitignore 文件的方法.如果没有 .gitignore 文件,就自己创建一个,手动创建会提示你输入文件名称,因此,你 ...

  3. 关于pragma pack的用法(一)

    一个很重要的参数#pragma pack(n) 数据边界对齐方式:以如下结构为例: struct {                    char a;                    WOR ...

  4. Java5 并发学习

    在Java5之后,并发线程这块发生了根本的变化,最重要的莫过于新的启动.调度.管理线程的一大堆API了.在Java5以后,通过 Executor来启动线程比用Thread的start()更好.在新特征 ...

  5. GRIB格式转换心得(转自博客:http://windforestwing.blog.163.com/blog/static/19545412007103084743804/)

    1.wgrib的使用 在cmd命令行下键入wgrib后即可察看wgrib相关命令参数,简要介绍如下: l        Inventory/diagnostic–output selections 详 ...

  6. CSS布局中——导航是非常常见的

    导航绝对是页面布局中最常见的,为了不用每次去写,稍微贴个简单的导航模版出来,方便以后使用. <title>CSS菜单</title> <style type=" ...

  7. ejabberd源码流程梳理

    ejabberd的工程主要通过ejabberd.app 组织起来 ejabberd.erl : application:start(ejabberd). ejabberd_app.erl: Mod:s ...

  8. 3D魔方游戏

    初学OpenGL时做的小程序,涉及到了OpenGL的大部分基本内容,如视图模型变换.色彩.纹理贴图.材质.光照.显示列表.选择等 三阶魔方有3×3×3个方块组成,每个方块的类当中都有一个4×4的矩阵, ...

  9. IE兼容性问题解决方案2--css样式兼容标签

    在页面中加入下面的标签: <meta http-equiv = "x-UA-compatible" content="IE=edge,chrome=1"& ...

  10. 数据库设置表的check约束出现乱码

    采用默认的方式见了一个数据库,但是有个表里需要建一个check约束.将约束保存之后再打开看到中文成了??.后来查了一下是数据库排序规则除了问题. 详见两图即可明白: 这里的约束中文显示乱码: 按下图设 ...