Pergunta

Due to the url length for js resources on my local dev site, it's really annoying to try to find the script I'm looking for.

Javasript Url too long

I'm using combres 2.2.2.4. Here's my relevant combres.xml section:

<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="KeepAll" />
      <param name="OutputMode" type="string" value="SingleLine" />
      <param name="RemoveUnneededCode" type="bool" value="true" />
      <param name="StripDebugStatements" type="bool" value="true" />
    </minifier>
    <minifier name="yui" type="Combres.Minifiers.YuiJSMinifier, Combres">
      <param name="IsVerboseLogging" type="bool" value="false" />
      <param name="IsObfuscateJavascript" type="bool" value="true" />
      <param name="PreserveAllSemicolons" type="bool" value="false" />
      <param name="DisableOptimizations" type="bool" value="false" />
      <param name="LineBreakPosition" type="int" value="80" />
    </minifier>
  </jsMinifiers>

  <resourceSets url="~/combres.axd" defaultDuration="30"
                                    defaultVersion="auto" 
                                    defaultIgnorePipelineWhenDebug="true" 
                                    defaultDebugEnabled="true"
                                    defaultJSMinifierRef="msajax" 
                                    defaultCssMinifierRef="yui" 
                                    defaultCompressionEnabled="true" >

Any thoughts?

Updates:

  1. I'm still not sure where those hash numbers are coming from. I've jiggled the defaultVersion, defaultVersionGenerator, and version tags of the resources, but I can't seem to see a change.

  2. I've just turned debug off, and I notice that in chrome, it shows

    /scripts /1

indicating that when debug is turned off, the defaultVersion works just as documented, but with debug on, the huge hashes are back. I'm looking into whether it's the version of Combres (we recently updated).

  1. Well, rolled back to 2.1.0.0, and I found the same behavior. It actually might not be Combres here, even though it looks like it should be. I'll continue hunting.
Foi útil?

Solução 2

Proposed by Buu Nguyen:

In Debug mode, the hash generation cannot be "turned off" via Combres configuration. However, it may be possible to modify GetResourceUrl to remove the hash from the Url.

Outras dicas

Looks Combres is configured to uses Sha512VersionGenerator (it doesn't show in your config segment, so I suppose that is set in other segments). Try either set versionGenerator of resourceSet (or defaultVersionGenerator of resourceSets, and remember to remove versionGenerator in resourceSet) to:

  • Combres.VersionGenerators.HashCodeVersionGenerator
  • Remove the versionGenerator attribute and manually set its version
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top