Hi, one of the things we're trying to do according to YSlow is to reduce the HTTP Requests by combining as many of the javascripts files as possible. In the latest AjaxControlToolkit we are able to combine scripts (and minify them) by doing this:
However, when using YSlow we noticed that one WebResource.axd file that's always downloaded separately on all of the pages, and YSlow complains that it's not minified. This file contains functions like WebForm_PostBackOptions() and WebForm_DoCallback().
I would like to know what the file is called and how we can combine it with the other scripts, if possible.
It turns out these types of script files are called by asp.net on the fly but they can be combined, if you know what the files are named and where assembly they come from. My code is shown below and it helped me reduce my HTTP requests by 2 calls.
There are also a number of other ASP.NET script files that are injected dynamically depending on what controls you have on the page. For example if you have a TreeView it will inject a script file called TreeView.js, if you have a GridView it will inject
GridView.js, and if you use code like ServerControl.Focus() it will inject Focus.js, and so on. You could also combine these but you may not want to if it's only used in a few of the pages so you don't end up with a overly large script file.
Can you tell us how you were able to correlate ScriptResouce.axd and WebResource.axd URLs to the embeded resource file names you are using in the CompositeScript element?
bc1016
Member
81 Points
77 Posts
Combine WebResource.axd files
Oct 14, 2011 07:12 PM|LINK
Hi, one of the things we're trying to do according to YSlow is to reduce the HTTP Requests by combining as many of the javascripts files as possible. In the latest AjaxControlToolkit we are able to combine scripts (and minify them) by doing this:
<ajax:ToolkitScriptManager ID="ScriptManager1" runat="server"> <CompositeScript> <Scripts> <asp:ScriptReference Name="MicrosoftAjax.js" /> <asp:ScriptReference Name="MicrosoftAjaxWebForms.js" /> other scripts...... </Scripts> </CompositeScript> </ajax:ToolkitScriptManager>However, when using YSlow we noticed that one WebResource.axd file that's always downloaded separately on all of the pages, and YSlow complains that it's not minified. This file contains functions like WebForm_PostBackOptions() and WebForm_DoCallback(). I would like to know what the file is called and how we can combine it with the other scripts, if possible.
Any ideas?
Thank you.
bc1016
Member
81 Points
77 Posts
Re: Combine WebResource.axd files
Oct 20, 2011 07:09 PM|LINK
After much looking I found this article which helped resolve my issue:
http://www.telerik.com/community/forums/aspnet-ajax/scriptmanager-and-stylesheetmanager/further-reduce-webresource-axd-calls.aspx
It turns out these types of script files are called by asp.net on the fly but they can be combined, if you know what the files are named and where assembly they come from. My code is shown below and it helped me reduce my HTTP requests by 2 calls.
<ajax:ToolkitScriptManager ID="ScriptManager1" runat="server"> <CompositeScript> <Scripts> <asp:ScriptReference Name="MicrosoftAjax.js" /> <asp:ScriptReference Name="MicrosoftAjaxWebForms.js" /> <asp:ScriptReference Name="WebForms.js" Assembly="System.Web" /> <asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" /> other scripts...... </Scripts> </CompositeScript> </ajax:ToolkitScriptManager>There are also a number of other ASP.NET script files that are injected dynamically depending on what controls you have on the page. For example if you have a TreeView it will inject a script file called TreeView.js, if you have a GridView it will inject GridView.js, and if you use code like ServerControl.Focus() it will inject Focus.js, and so on. You could also combine these but you may not want to if it's only used in a few of the pages so you don't end up with a overly large script file.
richardcolle...
Member
16 Points
12 Posts
Re: Combine WebResource.axd files
Dec 26, 2012 08:17 PM|LINK
Bill,
Can you tell us how you were able to correlate ScriptResouce.axd and WebResource.axd URLs to the embeded resource file names you are using in the CompositeScript element?
Thank you,
Rich