1

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.
llaughlin
  • 511
  • 7
  • 15
  • 1
    FYI, Chrome has updated itself so that it shows the BEGINNING of the urls instead of the end, so this isn't a problem anymore. In addition, I managed to get Combres to change the implementation a little bit. It will now only use a 32 character hash instead of the giant SHA512 one. http://combres.codeplex.com/discussions/348659 – InfinitiesLoop Apr 27 '12 at 04:32
  • Hah, that's excellent! I never thought this post would make it this far. Thanks for the bump @InfinitiesLoop! – llaughlin Apr 27 '12 at 13:11

2 Answers2

1

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
Buu
  • 49,745
  • 5
  • 67
  • 85
  • Thanks for the suggestions. They don't seem to have an effect, though. What might I be doing wrong? – llaughlin Feb 09 '12 at 15:53
  • 1
    Sorry I misread your question, didn't notice you actually want to run in debug mode. In debug mode, Combres appends the content hash to each resource so that every request will get the latest version. I don't think there's an option to turn this off, you could modify the WebExtensions.cs' GetResourceUrl to remove the hash appending though. – Buu Feb 10 '12 at 15:14
  • Hmm, not the answer I was hoping for, but I'll continue down that path. Thanks! – llaughlin Feb 10 '12 at 22:40
1

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.

llaughlin
  • 511
  • 7
  • 15