jquery - Why is Application_ResolveRequestCache have a long duration? -


i have asp.net application trace (log) tool. uses ajax retrieving data (controls). have 2 trace entries:

    protected void application_resolverequestcache(object sender, eventargs e)     {         log("application_resolverequestcache", null);     }      protected void application_acquirerequeststate(object sender, eventargs e)     {         log("application_acquirerequeststate");     } 

time diff between these 2 entries duration of application_resolverequestcache (i think). method log depends on singleton class, writes in httpcontext.current.trace

example: user on page, site sends 5 ajax requests (updates 5 controls) server. duration of application_resolverequestcache each request (in order time): 0.001, 1.518, 4.556, 5.057, , 5.575 (in seconds).

in global.asax have disabled cache via filters:

public static void registerglobalfilters(globalfiltercollection filters)         {             filters.add(new outputcacheattribute             {                 varybyparam = "*",                 duration = 0,                 nostore = true,             });         } 

so, why application_resolverequestcache takes time output cache disabled?

note: current issue ajax requests.

additional information:

ajax query:

jquery.ajax({             url: "/mvcget/ajax/loadcontrol/",             data: properties,             type: "post",             contenttype: "application/x-www-form-urlencoded",             async: true         }); 

loadcontrol action:

        [httppost]         public virtual actionresult loadcontrol()         {             var control = createcontrolfromrequest<itemplatedcontrol>();             control.saveuservalues();             var content = control.render();             return content(string.isnullorempty(content) ? " " : content);         } 

your test code isn't measuring time takes invoke resolverequestcache. instead, it's measuring time takes invoke between resolverequestcache , acquirerequeststate.

if you're making parallel requests server , if requests contain session cookie, asp.net runtime serialize requests. time spent holding these requests in pipeline show between resolverequestcache , acquirerequeststate method invocations.

see are ajax calls processed in serial fashion on server if use asp.net session state? more information on ajax + session.

edit: should mention few other events (such routing) occur between resolverequestcache , acquirerequeststate. if have many routes defined or if route matching logic particularly complicated, contribute increased time spent.

if you're going accurate performance measurements in web application, take @ http://www.iis.net/configreference/system.webserver/tracing.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -