是否MVC4捆绑和mimification做任何缓存? [英] Does MVC4 bundling and mimification do any caching?

查看:139
本文介绍了是否MVC4捆绑和mimification做任何缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用MVC4的捆绑和mimification功能,但我关心的mimification。难道每一次有来自客户端的捆绑/ mimification过程适用于CSS和JavaScript的请求的情况下。如果是这样的话,每次有没有CPU开销?

I would like to use the bundling and mimification features of MVC4 but I am concerned about the mimification. Is it the case that every time there is a request for css and javascript from a client that the bundling/mimification process works. If so then is there not a CPU overhead each time?

推荐答案

报价

捆绑和缩小主要是改善第一页请求
  加载时间。一旦网页被请求时,浏览器缓存
  资产(JavaScript,CSS和图像),因此捆绑和缩小不会
  请求相同的页面时提供任何性能提升,或页面
  在同一个站点请求相同的资产。

Bundling and minification primarily improve the first page request load time. Once a webpage has been requested, the browser caches the assets (JavaScript, CSS and images) so bundling and minification won’t provide any performance boost when requesting the same page, or pages on the same site requesting the same assets.

因此​​,资产会被浏览器缓存,并在随后的页面没有要求所以不会有性能损失。

So the assets will be cached by the browser and not requested on subsequent pages so there will be no performance hit.

注:有一个<一个href=\"http://todd-carter.com/post/2012/06/10/mini-me-fication-in-system-web-optimization-rc-is-evil/\"相对=nofollow>错误的ASP.NET MVC 4 RC 它不会在服务器端,希望这将固定在RTM进行缓存。所以调用视图中的 @ Scripts.Render 帮手的时候会有一个性能命中每次。

Remark: There's a bug in ASP.NET MVC 4 RC which doesn't perform caching at the server side which will hopefully be fixed in the RTM. So when calling the @Scripts.Render helper in the view there will be a performance hit everytime.

这篇关于是否MVC4捆绑和mimification做任何缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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