Is HTTPServerUtility.Transfer more convenient than Response.Redirect in site performance in asp.net?

Now I'm reading about the performance and scalability of the .net website.

I read a lot of blog posts and a Microsoft book about performance and scalability.

The latest blog is here .

In this blog poing no.6 talk about
"Use HTTPServerUtility.Transfer instead of Response.Redirect" ..

Is it more useful in website performance and for a point like a blog that

" They should only be used when transferring people to another physical web server. For any transfers on your server, use .transfer! You will save a lot of unnecessary HTTP requests. "

Can someone help me on how it is more useful in performance than response.redirect?

+5
source share
3 answers

You should not just blindly start using Server.Transferinstead Response.Redirect; they are not just replacements for replacement.

Server.Transferperforms another execution of the "lesson" when the current one is turned off, giving out its output. This saves the Redirect step - the redirect calls the 302 - Movedclient with a new download URL, and then the browser makes this new request. This is what is "saved" when you use Server.Transfer.

; , , Server.Transfer, - , Server.Transfer .

, , "" ; , .

Server.Transfer -, , ASP.NET HTTP-, ... , / .


EDIT: ; , -, . , . , ASP.NET/HTTP. - .

+6

Server.Transfer .. , , , , transfer vs redirect.

  • transfer , , , , .
  • transfer post back asp.net .
  • transfer, , , .
  • transfer, 2 .

redirect, , . , , .

Server.Transfer.

, Transfer . , , , , , , !.

protected void Page_Load(object sender, EventArgs e)
{
    // function works
    Thread.Sleep(10000);
    Server.Transfer("Page2.aspx");
}  

, , .

protected void Page_Load(object sender, EventArgs e)
{
    // function works
    Thread.Sleep(10000);
    Response.Redirect("Page2.aspx");
}

, , , .

+1

Server.Transfer Http; . , .

Response.Redierct

  • .
  • , Response.Redirect URL 302 .
  • 302 URL-.
  • URL- .

Server.Transfer

  • .
  • , Server.Transfer URL 302 .
  • 302 url.
  • , .

In short, you save one round trip with Server.Transfer . But the browser could not get the new URL.

Conclusion: . If you want to index your URLs with search engines or want your users to add URLs, then this Server.Transferwill not help.

Server.Transfer: only helps to hide the URL from the user or browser or search engines.

+1
source

All Articles