Asynchronous Pages Always?

V

Varangian

my question is when to use Asynchronous Pages and when to not?

Considering their advantage of not locking the UI thread for a
particular process whether long or not, I might think that it is
worthwhile to
use them for every single page, whatever the process.... but I may be
wrong.

what do you think?
Thanks!
 
G

Göran Andersson

Varangian said:
my question is when to use Asynchronous Pages and when to not?

Considering their advantage of not locking the UI thread for a
particular process whether long or not, I might think that it is
worthwhile to
use them for every single page, whatever the process.... but I may be
wrong.

what do you think?
Thanks!

Most web pages only fetch data once, so it's more efficient to just send
a complete page instead of making several requests to first get the page
and the fill it with data.

If you change the contents of the page, you often want the URL to
reflect the change, so you simply load a new page.

It's mostly for a bit more complicated scenarios, where you don't have
pages that can be indexed by search engines anyway, that asynchronous
pages can be handy.
 
V

Varangian

Most web pages only fetch data once, so it's more efficient to just send
a complete page instead of making several requests to first get the page
and the fill it with data.

If you change the contents of the page, you often want the URL to
reflect the change, so you simply load a new page.

It's mostly for a bit more complicated scenarios, where you don't have
pages that can be indexed by search engines anyway, that asynchronous
pages can be handy.

Thanks Goran Andresson

what has indexing by search engines has to do with it?

unreleasing the UI thread for another thread is less efficient
depending on the process time of the asynchronous process?

you said most web pages fetch data once.... not always... what if the
data is fetched constantly say every minute or so?
 
G

Göran Andersson

Varangian said:
what has indexing by search engines has to do with it?

If you have a web site, you usually want people to be able to find the
information on it.
unreleasing the UI thread for another thread is less efficient
depending on the process time of the asynchronous process?

There is no "UI thread" in a web application. The web server only
replies to requests, and it's about the same amount of work to reply to
a request for a page as it is to reply to a request for something else.

To make the pages load as quickly as possible, and for the server to be
able handle as many visitors as possible, you generally want to make as
few requests as possible.
you said most web pages fetch data once.... not always... what if the
data is fetched constantly say every minute or so?

That depends... You would have to look at the total amount of data you
need to send to the client. An asynchronous call usually gets less data
than reloading the page, but on the other hand the initial page has to
contain more code in order to be able to do the asynchronous call.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top