什么是ASP.NET捆绑在运行时的利益,缩小? [英] What is the benefit of ASP.NET bundling and minification in runtime?

查看:139
本文介绍了什么是ASP.NET捆绑在运行时的利益,缩小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何使用asp.net的新捆绑和缩小功能。他们在开发过程中是有益的。

I understand how to use asp.net's new bundling and minification features. They are helpful during development.

有没有在生产部署中使用它们虽然没有优惠?将系统有更好的表现,如果你只是放置在Web服务器上捆绑/缩小的文件?看来,总体而言,如果他们只是静态文件少code将运行。

Is there any benefit to using them in a production deployment though? Would the system perform better if you just placed the bundled/minified files on the web server? It seems that overall, less code would run if they were just static files.

请注意:我理解具有JS / CSS捆绑缩小的利益。我只质疑使用有源运行过程,以产生在生产系统中的那些文件,而不是简单地将它们存储在磁盘上并引用它们作为静态文件的值。

Note: I understand the benefit of having js/css bundled and minified. I am only questioning the value of using an active runtime process to generate those files in a production system as opposed to simply storing them on disk and referencing them as static files.

推荐答案

捆绑和缩小时生产比发展更有益。
它可以显著提高你的第一页命中下载时间。

Bundling and Minification is more useful in production than in development. It can significantly improve your first page hit download time.


  • 通过捆绑多个CSS文件和JavaScript文件合并成单一的CSS文件和JavaScript文件,减少个人的HTTP请求到服务器的数量。

  • Bundling reduces the number of individual HTTP requests to server by combining multiple CSS files and Javascript files into single CSS file and javascript file.

微小通过删除空白,注释和其他不必要的字符减少CSS和JavaScript文件的文件下载的大小。

Minification reduces the file download size of CSS and javascript files by removing whitespace, comments and other unnecessary characters.

这样小的优点是在生产环境中比在发展更明显。因此,它是更好地捆绑和微小去生产。

Such small advantages are more pronounced in a production environment than in development. So it is better to go with Bundling and Minification in production.

具体到你的问题没有在运行时绑定/缩小未扪及效益。此功能有只是为了让开发人员的工作更轻松。因此,它是更好的与捆绑手动/缩小的资产去生产,如果你清楚你在做什么。

Specific to your question there is no palpable benefit in bundling/minification during runtime. This feature is there just to make the developer's work easier. So it is even better to go with manually bundled/minified assets in production if you are sure about what you are doing.

更新:
 据 MSDN 没有在运行时绑定/缩小一个真正的好处。

Update: According to MSDN there is a real benefit in bundling/minification during runtime

捆绑并在ASP.NET 4.5缩小在运行时被执行,从而使该过程可以识别用户代理(例如IE浏览器,Mozilla的等),并且因此,通过靶向用户提高玉米pression浏览器(例如,去除的东西,是Mozilla的特定时请求来自IE).`

Bundling and minification in ASP.NET 4.5 is performed at runtime, so that the process can identify the user agent (for example IE, Mozilla, etc.), and thus, improve the compression by targeting the user browser (for instance, removing stuff that is Mozilla specific when the request comes from IE).`

动态捆绑的强大之处在于,可以包括静态的JavaScript,以及在语言的其他文件编译成JavaScript.`

The power of dynamic bundling is that you can include static JavaScript, as well as other files in languages that compiles into JavaScript.`

例如,CoffeeScript的是一种编程语言,编译成JavaScript

For example, CoffeeScript is a programming language that compiles into JavaScript

这篇关于什么是ASP.NET捆绑在运行时的利益,缩小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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