如何优化 Combres 设置(压缩、缩小)

发布于 2024-09-10 06:26:59 字数 3573 浏览 6 评论 0原文

谁能告诉我最佳的 Combres 设置吗?我有以下内容,但看起来好像我的 CSS 和 JS 没有被缩小。

<?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>

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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

陪你搞怪i 2024-09-17 06:26:59

要么在每个资源集标记中显式设置缩小器

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

,要么使用 defaultJSMinifierRefdefaultCssMinifierRef 在资源集标记中全局设置缩小器

<resourceSets url="~/combres.axd" 
            localChangeMonitorInterval="30"
            remoteChangeMonitorInterval="120"
            defaultDuration="30" 
            defaultVersion="1"
            defaultVersionGenerator="Combres.VersionGenerators.Sha512VersionGenerator"
            defaultJSMinifierRef="yui"
            defaultCssMinifierRef="yui" ...

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" ...
神回复 2024-09-17 06:26:59

我看到您

defaultDebugEnabled="auto" 

要么将其设置为 true,要么进入 web.config 并关闭调试。

我发现是关于如何开始使用combres的优秀教程。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文