Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ajax & performance

 
Vivek R Somani.
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it is known that using Ajax you can asychronously make calls to server with out reloading the whole page.

But what I have observed when using Ajax with faces (JSF) is that the whole page is submitted although the reloading happens for the specific part of the page. So how does really Ajax help in improving the performance?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pages are not submitted.
Can you elaborate on what you meant by that?
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AJAX is a client side component and it has a counter part at the serve side too.Using javascript objects it communicates to the server counterpart requesting for data and once the data is available in the client side , it again with the help of javascript renders the data in the browser.

The whole point of AJAX is that page should not be submitted.Javascript would make a internal request to the server for data.The browser URL remains the same and the complete page doesn't refresh.
One more thing is just because you are using AJAX doesn't mean that its improving your applications performance.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65220
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any such problem you encounter is a factor of JSF, not Ajax.
 
Alexei White
author
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree.. there may be a misunderstanding as to what should be happening with an AJAX request.

Ideally you make an AJAX request for a discrete piece of data.. like loading a page of records into a datagrid. The real advantage here is bandwidth. Even if the server runs through the entire execution lifecycle of the source document, the performance gain comes from
  • Fewer bytes transmitted
  • Client browser does not need to reinitialize the entire document (very slow)
  • Updates are made to the page via DHTML instead (very fast)
  • User gets to preserve their workflow, and page state overall.. which means more productivity for the user, and better perceived application performance.
  •  
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic