When I create a script bundle using Microsoft Web Optimization (bundling and minification for ASP.NET and MVC), does the server keep a copy of the bundle in memory? Or does it read from disk each time it gets a request to create the bundle? Read a number of blogs and articles on the subject but they only talk about the usage, benefits, etc.
I've even poked around the w3wp.exe process with WinDbg but I'm not smart enough or patient enough to find the bundles in memory to verify this. And just watching task manager doesn't seem reliable because obviously strings at some point will be loaded into memory, but .NET heap doesn't always shrink back down immediately. Thanks!
Short answer
Memory. But also remember that the browser already caches the information in the client.
Long answer
First of all, the bundle will be cached by the browser as it's said in the Bundling and Minification page:
And also shown here, in the image taken from the same page, where they tested with Fiddler:
So far we are safe as it's cached by the browser.
However, I went a bit further and created a small test project with this code in the Controller:
And this code in the View:
Which gave me the following results:
First run:
Second run:
On the second run you will see that modernizr, bootstrap, jquery and css (my bundles!) are in the cache. That would explain why if we load the same page in 2 different browsers we will get the same query string, even after being loaded 5mins apart: