user2471435
user2471435

Reputation: 1674

ASP.NET MVC Script Bundle Takes Too Long To Load

I am out of ideas on this one. An MVC site we developed takes too long to load. The Network tool shows it takes over seconds to load the JavaScript! It is in a bundle and being minimized. I can't figure out why this bundle could take so long. Any ideas?

bundles.Add(new ScriptBundle("~/scripts/site").Include(
                         "~/Scripts/lib/jquery-1.10.2.js"
                       , "~/Scripts/lib/jquery-migrate-{version}.js"
                       , "~/Scripts/lib/json2.js"
                       , "~/Scripts/lib/knockout-{version}.js"
                       , "~/Scripts/lib/jquery.unobtrusive*"
                       , "~/Scripts/lib/jquery.validate*"
                       , "~/Scripts/lib/jquery-ui*"
                       , "~/Scripts/lib/jquery.lockSubmit*"
                       , "~/images/jquery.js"
                       , "~/images/script.js"
                        ));

Here is the Network Tab of the Dev Tools:

enter image description here

Upvotes: 1

Views: 1334

Answers (1)

Yasser Shaikh
Yasser Shaikh

Reputation: 47794

Looking by your network tab screen grab, you have bundled a lot of files together and the size is 0.63 MB which is too big a size for minimized js files.

One thing you could do is split your js files into seperate bundles. Also could u share the actual size of the js files you are using, I find it very strange that the files you mentioned after minimized is still too big.

Upvotes: 1

Related Questions