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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Quote:
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.
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.