title: Minifying and combining files in .net
body: <p>I am looking at implementing some performance optimization around my javascript/css. In particular looking to achieve the minification and combining of such. I am developing in .net/c# web applications.</p>
  
  <p>I have a couple of options and looking for feedback on each:</p>
  
  <p>First one is this clever tool I came across Chirpy which via visual studio combines, minifies etc -> <a href="http://chirpy.codeplex.com/" rel="noreferrer">http://chirpy.codeplex.com/</a> This is a visual studio add in but as I am in a team environment, this tool isnt ideal.</p>
  
  <p>My next option is to use an Msbuild task (<a href="http://yuicompressor.codeplex.com/" rel="noreferrer">http://yuicompressor.codeplex.com/</a>) to minify the files and also combine them (maybe read from an xml file what needs to be combined). While this works for minifying fine, the concern I have is that I will have to maintain what must be combined which could be a headache.</p>
  
  <p>3rd option is to use msbuild task just for the minifying and at runtime using some helper classes, combine the files on a per page basis. This would combine the files, give it a name and add a version to it.</p>
  
  <p>Any other options I could consider? My concern with the last option is that it may have performance issues as I would have to open the file from the local drive, read its contents and then combine the files. This is alot of processing at run time. I was looking at something like Squishit - <a href="https://github.com/jetheredge/SquishIt/downloads" rel="noreferrer">https://github.com/jetheredge/SquishIt/downloads</a> This minifies the files at run time but I would look at doing this at compile time.</p>
  
  <p>So any feedback on my approaches would be great? If the 3rd option would not cause performance issues, I am leading towards it. </p>