Correct way to bundle in MVC4

前端 未结 1 1092
感情败类
感情败类 2021-01-04 14:12

I\'m a bit confused on the correct way to bundle script and style files. Currently, my BundleConfig.cs looks like this:

bundles.Add(new ScriptBundle(\"~/bun         


        
相关标签:
1条回答
  • 2021-01-04 14:59

    If you are always using all of the files than go ahead and stick them in two bundles; one for the javascript and one for the styles. Fewer bundles means fewer requests to the server to fetch the resources, which may result in marginally better performance on the first hit; subsequently the files will be cached by the browser.

    If you are not always using all of the files than it makes more sense to break them out into more bundles.

    0 讨论(0)
提交回复
热议问题