SHA hash generated on urls when in debug mode with defaultIgnorePipelineWhenDebug

Mar 14, 2012 at 11:58 PM

It's great that you can skip the pipeline in debug mode using defaultIgnorePipelineWhenDebug. But the urls generated have an enormous hash appended to them. This hash appears to be a SHA512 hash and it is generated regardless of the Version generator assigned to the resource set. Looking at the code, GetResourceUrl() appends it without using a version generator. There's simply no way to disable this.

I understand the reason for the hash -- it guarantees the browser is not caching the script should you make changes. But IMO it's unnecessary. It's nothing a browser refresh wouldn't fix to force it to re-request the script. 

It's very obtrusive because in Chrome debugging tools, the urls are so long it is basically impossible to use. Look at the screenshots in this SO question to see what I mean: 

I'd like at least a way to turn this off or for it to just use an integer hash so it isn't so long, ugly, and obtrusive.

Apr 26, 2012 at 11:05 PM

How about retaining the first 32 chars?  Hopefully the collision rate won't be so bad.  I don't want to just remove that feature because some people may already depend on it and feel comfortable with it being there.

Apr 27, 2012 at 12:06 AM

Well, to be fair, Chrome fixed it so it shows the beginning of the url instead of the end. :) So it isn't really a problem anymore.

Although I personally would still prefer they be gone -- I guess I'm just one of those devs that likes to see clean html, even in dev mode. Plus the fact that it shouldn't technically be necessary. I could understand not wanting to add even more configurable cruft though, so I'll just leave it at that -- not a problem anymore, thanks to Chrome changing how they show it.

Apr 27, 2012 at 1:50 AM

I just noticed that too when testing the change.  Anyway, I've changed it to retain the first 32 chars.  I agree that this feature isn't necessary (overengineering!), if Combres doesn't have it, nobody would probably request for it.  But since it has been there since the beginning, I think I shouldn't just remove it in case someone already uses it.

The change is pushed to Nuget already, if you're interested.

Apr 27, 2012 at 1:51 AM

Excellent, thanks! :)