Combres js url 对于 Chrome 开发者工具来说太长
由于我本地开发站点上 js 资源的 url 长度,尝试找到我正在寻找的脚本真的很烦人。
我正在使用combres 2.2.2.4。这是我的相关combres.xml部分:
<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" >
有什么想法吗?
更新:
我仍然不确定这些哈希值来自哪里。我已经调整了资源的 defaultVersion、defaultVersionGenerator 和版本标签,但我似乎看不到变化。
我刚刚关闭了调试,我注意到在 chrome 中,它显示了
/脚本 /1
表示当调试关闭时,defaultVersion 的工作方式与记录的一样,但是当调试打开时,巨大的哈希值又回来了。我正在研究是否是 Combres 的版本(我们最近更新了)。
- 好吧,回滚到 2.1.0.0,我发现了同样的行为。实际上这里可能不是康布尔,尽管它看起来应该是。我会继续狩猎。
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.
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:
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.
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).
- 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来 Combres 配置为使用
Sha512VersionGenerator
(它没有显示在您的配置段中,所以我认为它是在其他段中设置的)。尝试设置resourceSet
的versionGenerator
(或resourceSets
的defaultVersionGenerator
,并记住删除versionGeneratorresourceSet
中的 code>)改为:Combres.VersionGenerators.HashCodeVersionGenerator
versionGenerator
属性并手动设置其版本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 setversionGenerator
ofresourceSet
(ordefaultVersionGenerator
ofresourceSets
, and remember to removeversionGenerator
inresourceSet
) to:Combres.VersionGenerators.HashCodeVersionGenerator
versionGenerator
attribute and manually set its versionBuu Nguyen 提出:
在调试模式下,哈希生成无法通过 Combres 配置“关闭”。但是,可以修改 GetResourceUrl 以从 Url 中删除哈希值。
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.