1

I support corporate intraweb ASP.NET WebForms application. Recently users started to experience extremely slow page loads on this webapp. After eliminating all possibilities, I ended up with IE9 having troubles reading some files from local cache. Please see the picture.

It takes a bit more than 10 seconds to obtain the file. This totals page load time to about a minute. Is there any way to fix it? Chrome works fine, but I need IE. The WebResource.axd calls are generated by RadControls. Debug mode is false. Anyway, it worked fine last week with debug mode=true.

UPD: The issue was caused by KAV antivirus software. Lags disappear after either lowering heuristic level or changing the check mode to "On execution".

swingaroo
  • 15
  • 3

1 Answers1

0

Actually you do not get the files from the cache right away but you ask the server, then the server replay with "Not Modified 304".

I also notice the the problems start after the load of the /ErrorMonitoring.svc/jsdebug

and also not that the type change to text/javascript from application/x-javascript

Two thinks I suggest, with out knowing if this can help you for sure. First, add cache on webresource with out the need of asking the server. Here is a code that I use on global.asax

protected void Application_BeginRequest(Object sender, EventArgs e)
{
    HttpApplication app = (HttpApplication)sender;
    string cTheFile = HttpContext.Current.Request.Path;

    if (cTheFile.EndsWith("WebResource.axd", StringComparison.InvariantCultureIgnoreCase))
    {
        app.Response.Cache.SetExpires(DateTime.UtcNow.AddHours(4));
        app.Response.Cache.SetMaxAge(new TimeSpan(4, 0, 0));
        app.Response.Cache.SetCacheability(HttpCacheability.Public);    
    }    
}

and second, check to see if you need the jsdebug, in general maybe this can add extra code that slow down the ie trying to debug the javascript errors ? I do not know.

and about the text/javascript maybe you need to test this out also, if you can change it to see if this is the reason. Also you can read: When serving JavaScript files, is it better to use the application/javascript or application/x-javascript

Community
  • 1
  • 1
Aristos
  • 66,005
  • 16
  • 114
  • 150
  • Thank you for the answer, it turned out the problem was in antivirus software that suddenly got paranoid. – swingaroo Feb 09 '12 at 07:55
  • @swingaroo very intresting ! How ever the cache code here can speed up a little you page and avoid some calls to the server. – Aristos Feb 09 '12 at 07:59