Does MVC4 bundling and mimification do any caching?

假如想象 提交于 2020-01-03 19:40:28

问题


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.



来源:https://stackoverflow.com/questions/11048011/does-mvc4-bundling-and-mimification-do-any-caching

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!