Server.Transfer takes more time than direct call

83 views Asked by At

I have a page "screen_test.aspx". When I am calling this page directly like "server/application/screen_test.aspx". This is taking 50 ms to load.

Now I have a intermediate page which checks security "secure.aspx?name=screen_test" . It check security and transfer the page to "screen_test.aspx". In this process when calling "secure.aspx?name=screen_test" it takes 300ms.

In "secure.aspx" I am not checking any security for now and just doing

string name = Request.QueryString["name"];
Server.Transfer(name , true);

Why it is taking that much time (300 ms) to just transfer?

Is there a way I can improve page loading speed?

1

There are 1 answers

0
Ricky On

When you use the Transfer method, the state information for all the built-in objects are included in the transfer. This means that any variables or objects that have been assigned a value in session or application scope are maintained. In addition, all of the current contents for the Request collections are available to the .asp file that is receiving the transfer.