Hi there,
I have been experimenting with the AJAX Extensions for a while, and I have been looking at performance and other related characteristics of AJAX-izing my controls.
One question that came to mind is whether an AJAX-enabled control can reduce the back-end processing load. It might have been published somewhere before, so I apologize for the repeat in that case.
I noticed that when the client causes an AJAX postback through an UpdatePanel, it seems that the server would reload the entire web form and all its components/controls, but just sends the new UpdatePanel content back to the client. While this most certianly reduces egress, the back-end processing cost is not reduced. And with the help of AJAX controls, people tend to put more content on the same page. And in an obscure way, it actually increases server load, because the cost to refresh a portion of the page is computationally equal to a full refresh of the page, which is now more expensive because we put more content in a single page (i.e. more DB hits, etc).
I reckon that there might be documented ways to indicate that a custom control is somewhat "independent" in that a refresh does not require new data outside of the control itself (e.g. a custom control that just updates the current time every time the user clicks a button), but I haven't found any yet. Ideally, this control can live in a complicated page that requires several DB hits to refresh, but it would be great to have a way where a refresh postback to this AJAX control would cause the server to only execute the code of this control, and not re-process the entire page and incurr several extra DB hits.
If anyone knows of any such tricks or guidelines, I would really appreciate it if you could share. :-)
Thanks in advance,
- K.
hello.
well, the only way you have to build controls that integrate into ASP.NET and that are refreshed without full postbacks is to use the ICallbackEventHandler interface that was build into ASP.NET. btw, I'm not sure that you'll be gaining much by using this approach, but it exists.
regarding your remarks, what I can say is that web built AJAX pages will have most of their load in the client side, and will only use web services (or handlers) to get its data from the server side. This means that you'll have lots of JS to write, but again, that is why AJAX has a J, right?
Yes the UpdatePanel does not reduce the Server Load. Instead it offloads the data transfer of the wire and you should properly use it. To create more scalable application you can choose the Cient Centric Development Model but in that case you may have to write quite a lot of JavaScript depending upon the applicaiton you are building.
Regarding the ICallback of the Control also executes the full life cycle of the page. Moreover it only supports string for request/response as there is no serializer which does not do the conversation which is the case of Asp.net Ajax.
Thank you Kazi, I think this concurrs with my thinking and I appreciate your help.
However, others please chime in if you have other comments or nifty tricks that I can use.
Thanks,
- K.
No comments:
Post a Comment