This is great as it saves bandwidth by both reducing the number of requests that need to be made, as well as compacting the files by removing excess white space and comments.
One of the additional benefits of using SquishIt is built in support for dotLess. dotLess is a .Net port of the CSS extension Less, which was originally implemented for Ruby. This adds a number of neat features such as variables and mixins, which makes it easier to create well structured and maintainable CSS.
In release mode this will combine the separate files into a single file with the specified name, as well as performing minification.
When running with debug on in your web.config (<compilation debug=”true”>), the files are not combined by default. You can alter this behaviour by chaining a call to ForceRelease() before the call to Render(). Likewise, a call to ForceDebug() can be made to keep everything seperate when doing a release build with debug off.
Using Multiple Layouts
There are two ways round this:
2) Change the name of the output files depending on the view. This will ensure that re-minification only occurs when there are actual changes to the source files.
One thing to note is that when using a release build, SquishIt may require write access to the directory containing the target files, which in our case is ~/Content. This is because should any of the source files be updated, SquishIt will want to output a new ‘squished’ version.