ASP.NET MVC 3:帮助程序将 JavaScript 链接转换为嵌入/压缩的 html 标记?
是否有一个 MVC 3 助手可以压缩并在从服务器发送的原始 HTML 中包含链接的 JavaScript / CSS,这样客户端就不必将其作为单独的请求获取?
我们开始在云中存储链接图像,而 ASP.NET 代码则在本地托管。它允许 100 次请求,但后续请求将永远持续。
我们需要第一个 html 请求包含所有内容,而不是对服务器进行多次回调。我认为如果存在能够识别/压缩/点融合发送给客户端的原始 HTML 中的 JavaScript/CSS 的东西,那么效率会更高。它也可以被缓存。
Is there a MVC 3 helper that could compress and include linked JavaScript / CSS in the original HTML sent from the server so the client wouldn't have to go get it as a separate request?
We started storing linked images in the cloud while our ASP.NET code is locally hosted. It allows 100 times the requests but subsequent requests take forever.
We need the first html request to include everything rather than several call backs to the server. I thought if something existed to identify/compress/dotfuscate JavaScript/CSS in the original HTML sent to the client, it would be much more efficient. It could be cached too.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不认为这是一个答案,因为就我而言,我的 js 没有链接。我使用了许多帮助程序在脚本块中进行渲染,并为特定的页面任务替换了参数。但我所做的是将所有这些帮助程序包装在一个通用函数中,该函数在 DEBUG 中仅返回纯脚本块,但在发布中,使用 Yui 压缩器。
希望这能有所帮助。
I don't think this is an answer because in my case, my js was not linked. I used a number of helpers to render in script blocks with substuted params for specific on-page tasks. But what I did do was wrap all these helpers thru a common function which in DEBUG just returned the plain script block, but in release, compressed the js string with the Yui Compressor.
Hope this helps somehow.