2010-07-15 35 views
3

任何人都可以告訴我最優化的Combres設置嗎?我有以下內容,但看起來好像我的CSS和我的JS沒有被縮小。如何優化Combres設置(壓縮,縮小)

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

回答

6

任一組明確的使用defaultJSMinifierRefdefaultCssMinifierRef

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

有更好的縮小器嗎?一個具有最佳性能的飛行縮小? – 2010-09-13 16:15:37

+0

我必須說我沒有測試整套縮小器。由於縮小的結果被緩存了30分鐘(在這個例子中),這是我現在沒有考慮的優化。 – samy 2010-09-14 06:33:49

+0

我認爲,雖然谷歌封閉編譯器需要去服務器之旅(除非我錯了,我沒有看到它在梳理大會的源代碼),所以它可能是一些考慮 – samy 2010-09-14 06:35:22

4

我看到每一個的ResourceSet標籤​​

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

或設置在該resourceSets標籤全球範圍內minifiers minifiers你有

defaultDebugEnabled="auto" 

要麼將​​其設置爲true,要麼進入web.config並關閉調試。

我發現this是關於如何開始梳理的優秀教程。