开发者

ASP.NET MVC 3: Helper to turn JavaScript link in to embedded / compressed html markup?

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 b开发者_运维问答e much more efficient. It could be cached too.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜