views:

38

answers:

2

Can anybody tell me the most optimal Combres settings? I've got the following but it appears as though my CSS and my JS are not being minified.

<?xml version="1.0" encoding="utf-8" ?>
<combres xmlns='urn:combres'>
    <filters>
        <filter type="Combres.Filters.FixUrlsInCssFilter, Combres" />
        <filter type="Combres.Filters.DotLessCssFilter, Combres" acceptedResourceSets="dotLessCss" />
    </filters>
    <cssMinifiers>
        <minifier name="yui" type="Combres.Minifiers.YuiCssMinifier, Combres">
            <param name="CssCompressionType" type="string" value="StockYuiCompressor" />
            <param name="ColumnWidth" type="int" value="-1" />
        </minifier>
    </cssMinifiers>
    <jsMinifiers>
        <minifier name="msajax" type="Combres.Minifiers.MSAjaxJSMinifier, Combres" binderType="Combres.Binders.SimpleObjectBinder, Combres">
            <param name="CollapseToLiteral" type="bool" value="true" />
            <param name="EvalsAreSafe" type="bool" value="true" />
            <param name="MacSafariQuirks" type="bool" value="true" />
            <param name="CatchAsLocal" type="bool" value="true" />
            <param name="LocalRenaming" type="string" value="CrunchAll" />
            <param name="OutputMode" type="string" value="SingleLine" />
            <param name="RemoveUnneededCode" type="bool" value="true" />
            <param name="StripDebugStatements" type="bool" value="true" />
        </minifier>
    </jsMinifiers>

    <resourceSets url="~/Extras" 
                  defaultDuration="30"
                  defaultVersion="auto"
                  defaultDebugEnabled="auto" >

        <resourceSet name="siteMaster.Js" type="js">
            <resource path="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" mode="dynamic" />
            <resource path="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js" mode="dynamic" />
            <resource path="~/Assets/Scripts/jquery.corner.js" />
            <resource path="~/Assets/Scripts/MyApp.Combined.Master.js" />
        </resourceSet>

        <resourceSet name="mobileMaster.Js" type="js">
            <resource path="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" mode="dynamic" />
            <resource path="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js" mode="dynamic" />
            <resource path="~/Assets/Scripts/jquery.corner.js" />
            <resource path="~/Assets/Scripts/MyApp.Combined.Master.js" />
        </resourceSet>

        <resourceSet name="siteMaster.Css" type="css">
            <resource path="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/base/jquery-ui.css" mode="dynamic" />
            <resource path="~/Assets/Css/Site.css" />
        </resourceSet>

        <resourceSet name="mobileMaster.Css" type="css">
            <resource path="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/base/jquery-ui.css" mode="dynamic" />
            <resource path="~/Assets/Css/Mobile.css" />
        </resourceSet>

        <resourceSet name="bingMaps.js" type="js">
            <resource path="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2" mode="dynamic" />
            <resource path="~/Assets/Scripts/Bing-Maps.js" />
        </resourceSet>
    </resourceSets>
</combres>
+1  A: 

Either set explicitly your minifiers in each resourceSet tag

<resourceSet name="jsSet" type="js" version="1" minifierRef="yui" ...

Or setup the minifiers globally in the the resourceSets tag using defaultJSMinifierRef and defaultCssMinifierRef

<resourceSets url="~/combres.axd" 
            localChangeMonitorInterval="30"
            remoteChangeMonitorInterval="120"
            defaultDuration="30" 
            defaultVersion="1"
            defaultVersionGenerator="Combres.VersionGenerators.Sha512VersionGenerator"
            defaultJSMinifierRef="yui"
            defaultCssMinifierRef="yui" ...
samy
is there a better minifier? One that has the best performance for on-the-fly minification?
rockinthesixstring
I must say i didn't test the whole set of minifiers. Since the minified results are cached for thirty minutes (in this example), it's an optimization i didn't consider right now.
samy
i think though that the google closure compiler needs to make a trip to the server (unless i'm mistaken, i didn't see it in the source code for the combres assembly) so it may be something to consider
samy
A: 

I see you have

defaultDebugEnabled="auto" 

Either set that to true or go into the web.config and turn off debug.

I found this to be an excellent tutorial on how to get started with combres.

Mr Rogers