Check out ASP.NET Web Optimization in ASP.NET MVC 4. Read more on Howard’s blog here: http://codebetter.com/howarddierking/2012/08/03/whats-next-for-asp-net-web-optimization/
Andrey Kuleshov commented
It worths to note Cassette from Andrew Davey here
Sergiy Galay commented
Telerik mvc controls already have such functionality (combine/pack/cache css/js files). It's very useful. It would be very nice to see that integrated into mvc framework
Emmanuel Morales commented
This should be baked into the framework or provided as an extension and utilize a provider model to swap out the base implementation if desired.
Andrew Pierro commented
There are tons of great things like this out there. I am also using SquishIt myself now. However, this really should be a part of MVC as it is something which almost everyone is going to need at some point. Also, simple combining or packing is easy, but I would prefer to have an 'official MVC' solution which I new was going to handle all the URL rewrites correctly and would better support things like pulling the CSS/JS from an embedded resource.
Gregory Waxman commented
https://github.com/jetheredge/SquishIt handles this as well and lets you maintain caching configuration through your web.config.
Sergey Fadeev commented
I've done this and it works like a charm.
Wayne Brantley commented
chirpy http://chirpy.codeplex.com/ to minify/combine and t4mvc to generate these checksums for you all done at compile time. http://mvccontrib.codeplex.com/wikipage?title=T4MVC&referringTitle=Documentation
this is what i nearly do. slightly different. i have
where files_basic_checksum is the filename + lastmodifieddate + compressionlevel of the js files im including as one then md5ed.
that way if i change one file, or decide to minify the file more, the url changes and the user gets a new copy.
also since the url for that file will always be unique and if any changes to the files happen its a new URL, i can set the cache for that file for 10 years users only ever have to download it once.
i also do this for CSS files.
for master pages, i have a global set of css and js files I include on every page.