ASP NET forms Authorization: how to reduce duration?

Posted by eddo on Stack Overflow See other posts from Stack Overflow or by eddo
Published on 2012-06-03T16:25:39Z Indexed on 2012/06/03 16:40 UTC
Read the original article Hit count: 197

I've got a web page which is implementing cookie based ASPNET Forms Authentication.

Once the user has logged in the page, he can edit some information using a form which is created using a partialview and returned to him as a dialog for editing. The action linked to the partial view is decorated as follows:

[HttpGet]
[OutputCache(Duration = 0, VaryByParam = "None")]
[Authorize(Roles = "test")]
public ActionResult changeTripInfo(int tripID, bool ovride=false) 
{
     ...
}

The problem i am experiencing is the latency between the request and the time when the dialog is shown to the user: time ranges between 800 and 1100 ms which is not justified by the complexity of the form.

Investigating with Glimpse turns out that the time to process the AuthorizeAttribute (see snip) sums up to at least 650 ms which is troubling me. Looking at the Sql server log, the call which checks the user roles takes, as expected, virtually nothing (duration 0). How can I reduce this time?

Am I missing some optimization?

timeline report

© Stack Overflow or respective owner

Related posts about asp.net-mvc-3

Related posts about forms-authentication