如何组合 WebResource.axd 和 ScriptResource.axd 文件以减少对 ASP.NET 服务器的请求? [英] How do I combine WebResource.axd and ScriptResource.axd files so as to result in less requests to my ASP.NET server?

查看:24
本文介绍了如何组合 WebResource.axd 和 ScriptResource.axd 文件以减少对 ASP.NET 服务器的请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我正在处理的网站上,页面正在生成 45 个外部 WebResource.axd 和 ScriptResource.axd 文件,因此浏览者必须请求所有 45 个引用.这是很多参考资料,所以我想知道是否有一种方法可以将所有这些请求合并为一个请求?我已经看到脚本管理器应该能够对此做一些事情,但我没有看到 WebResource.axd 和 ScriptResource.axd 文件的任何结果.

On a site I'm working on, the pages are generating 45 external WebResource.axd and ScriptResource.axd files so the broswers have to request all 45 references. That's a lot of references so I'd like to know if there is a way that all of those requests could be combined into one request? I've seen that the Script Manager is supposed to be able to do something regarding that but I haven't seen any results with the WebResource.axd and ScriptResource.axd files.

我将如何将这些组合在一起?

How would I go about getting these to all combine?

推荐答案

正如其他人所说,使用 ASP.NET AJAX Toolkit 的 ToolkitScriptManager 而不是默认的 ASP.NET ScriptManager 将允许您进行一些脚本组合,包括您的自己的脚本作为资源嵌入 - 在 脚本组合变得容易.

As the others have stated, using the ASP.NET AJAX Toolkit's ToolkitScriptManager rather than the default ASP.NET ScriptManager will allow you to do some script combining, including your own scripts embedded as resources - there's a good post about it at Script combining made easy.

如果您有幸使用 ASP.NET 3.5 SP1,那么 ASP.NET ScriptManager 中还有一些附加功能,允许您将更多脚本(包括解决方案中的通用 .js 文件)合并到一个脚本调用中.

If you have the luxury of using ASP.NET 3.5 SP1, then there are some further additions to the ASP.NET ScriptManager that allow you to combine a lot more scripts, including general .js files in your solution into one script call.

在此处查看视频:

使用脚本组合提高性能

这篇关于如何组合 WebResource.axd 和 ScriptResource.axd 文件以减少对 ASP.NET 服务器的请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆