WebResource.axd and ScriptResource.axd load very slowly
Asked Answered
U

4

10

Under normal circumstances the two .axd files load at normal speeds to the browser, i.e. a few hundred milliseconds. I can see them load normally along with all the other page elements by looking at the waterfall chart (network chart) in chrome or another debugging tool.

Occasionally some kind of issue occurs where the two files take about a minute to load. Here are a few other notes:

  • All other elements on the page load at normal speeds.
  • It generally occurs once or twice a day and lasts for a few minutes.
  • I can see Requests Queued spike on performance counters at the same time.
  • CPU, memory and disk all stay normal during this time.
  • Had one outage of a few hours today that required an application restart to resolve.
  • Not combining the .axd files or anyhing like that yet.
  • Have URL rewriting implemented site-wide. axd files are excluded from rewriting.
  • App built for C# 3.5
  • IIS 7
  • I’m using the CDN version of ScriptManager, eg:

    <asp:scriptreference name="MicrosoftAjax.js" path="http://ajax.microsoft.com/ajax/3.5/MicrosoftAjax.js"></asp:scriptreference>

It looks like others have had a similar issue, but not solved:

WebResource.axd and ScriptResource.axd weird behaviour

WebResource.axd & ScriptResource.axd loading takes more than 1 minute

Question:

Any idea how to figure out what is causing these two files to load so slowly occasionally?

Also, are there any workarounds, such as prebuilding the .axd files or something..?

Unionist answered 26/4, 2011 at 12:54 Comment(2)
could you give more details about the situation/what you did? before the network blocking occured? Hope rebuilding the application could solve the problem but it's not such a good solutionDecaffeinate
Problem occurs intermittently every couple of days, not after any specific changes. Site get's rebuilt pretty much every day as new features are rolled in..Unionist
S
1

Maybe hosting http://ajax.microsoft.com/ajax/3.5/MicrosoftAjax.js locally would help?

Sullyprudhomme answered 26/4, 2011 at 13:23 Comment(1)
Hi, I don't think that would change the way the two .axd files are requested..?Unionist
N
1

I have some suggestions that probably help.

  • download the latest version of Ajax Control Toolkit
  • Run it on release mode by setting on web.config

    <deployment retail="true" ...>
    
  • Do not load from other sites your javascript, but get it on your disk and load it from your server direct.

Test them to see if your problem go way.

Northcutt answered 30/4, 2011 at 7:41 Comment(5)
Thanks Aristos. Sorry, perhaps I'm lacking some experience here, but how will that fix the problem with .axd files being fetched slowly..? Will it change the loading behaviour of these files..?Unionist
Are you suggesting something like this? #505916Unionist
@Dave I am not sure 100% that this can solve the problem, but I tell you why I suggest them. First the retail=true removes all the debug messages and comments and make the files load quick. There is always the possibility a debug message appear and create the delay. Second get the latest version, this always can eliminates older reported bugs and problems. And final do not load script from other sites because there is always the possibility to fail to load for some random reasons that you can not control, because is not your site.Northcutt
@Dave I suggest also something like the one you say, and this is not my suggestion but a general good practice. You need to load all you scripts in 1 or 2 files, there are many ways to do that, personally I have create my code to do that with this Microsoft Ajax Minifier asp.net/ajaxlibrary/ajaxminquickstart.ashxNorthcutt
Thanks Aristos, I'll investigate this path. There are only two .axd files being loaded and it's definitely not loading debug versions. Also, the CDN hosted version of MicrosoftAjax.js loads perfectly when this issue occurs. This issue is intermittent but can occur for a few hours until I restart the app pool..Unionist
K
1

Basically, these axd files are handlers, and you may be already aware that handler code will be executed by the ASP.net engine. These handlers simply emit a js file.

My calculated guess here, is that the application domain or the worker process is recycling. Check your performance monitor and take a look at Application Restarts counter along with Worker Process restarts.

Kantor answered 6/5, 2011 at 9:38 Comment(0)
S
-1

If the .axd files are static and don't change then I see no problem saving them and referencing them as js files.

Stingo answered 4/5, 2011 at 4:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.