如何优化 Combres 设置(压缩、缩小)
谁能告诉我最佳的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要么在每个资源集标记中显式设置缩小器
,要么使用 defaultJSMinifierRef 和 defaultCssMinifierRef 在资源集标记中全局设置缩小器
Either set explicitly your minifiers in each resourceSet tag
Or setup the minifiers globally in the the resourceSets tag using defaultJSMinifierRef and defaultCssMinifierRef
我看到您
要么将其设置为 true,要么进入 web.config 并关闭调试。
我发现此是关于如何开始使用combres的优秀教程。
I see you have
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.