0

I have recently implemented bundling in to my MVC project so I can automatically minify my scripts and styles. I have made around 10 scripts in to a bundle and 10 styles in to a bundle and have implemented them in my layout succesfully.

What I did notice is that basically my server response is now longer while and my js/scripts load times are now minimal. So I went from 1.9s on load time of the html and around 2s to scripts and styles to 3.9s load time on html and around 300ms on scripts and styles.

So I have to ask, how does bundling actually work? Is a package created on the IIS that is always implemented on the pages or is the package created everytime an html request is made? Or maybe the minification is done on request or the CssTransformation?

misha130
  • 5,457
  • 2
  • 29
  • 51

2 Answers2

2

Bundles are cached. If not specified differently in bundle class then bundle is created on first request and cached on server. All following requests for bundles are served from cache. Link

user1924375
  • 10,581
  • 6
  • 20
  • 27
1

Bundles basically help with the number of network request and responses to download the multiple css or/and js files. So if you minify all your js and css then the amount of data that are being downloaded will be almost the same as you do bundling, but the number of downloads will be limited to 2 files (one css one js) rather than so many js and css files that are being downloaded...

Aram
  • 5,537
  • 2
  • 30
  • 41