Sahi
Sahi

Reputation: 1484

Bundling with one file

I have a view with several partial views. The view loads several javascript file as a single bundle. but one js file differ based on the partial view.

Can i bundle one file in my partial, will it improve performance. or how can i minify that file in order to improve performance.

Upvotes: 0

Views: 68

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1038710

You'd rather have a single bundle containing all your resources. Even if they are not used on each views, the fact that you have a single bundle that will be downloaded only once and cached subsequently will be better compared to have different bundles for the different views resulting on different HTTP requests to fetch them. Remember that minifying and gziping the bundle would greatly reduce its size, so it shouldn't make big difference when initially downloading this bundle.

Upvotes: 2

Related Questions