Pushed into MvcContrib as MvcContrib.IncludeHandling. A component for concatenating, minifying, compressing and caching scripts & CSS within an ASP.NET MVC site to improve front-end performance.
A method to render out a script element whose src points to the include-combination, and one to render out a link element whose href points to the include-combination.
Current limitation - CSS files must at the same depth as that of the include-combiner action call, because url() within CSS files should be relative to the CSS file.
Don't want to force absolute paths in CSS files.
Don't want to break background-images within CSS files, if they come from a different depth.
Don't want to have one CSS file for those parts that use url() references.
So, parse the CSS files when they're registered and change the url() references to the correct depth.
Since we want to do different things with the rendering in debug-mode, we need to know when we're in debug-mode.
When we see debug=1 in the querystring, we're in debug mode. Also, since we may want to navigate to a page while in debug mode, and have that also be in debug mode, set a cookie (instead of modifying all the links on the page, for example).
Run YUICompressor over the IncludeCombination's content to strip whitespace, etc.
Note - will need to figure out how to handle relative URLs in CSS files, since they are relative to the CSS file itself. So when reading them, will need to rebase them.
It would be useful to some to set up routes according to where they want the includecontroller to sit. Allow one configuration-element per route, and provide an initialize-it-all mechanism.