What is Ajax?
Flow of Ajax Requests should be reduces
For beginners Ajax can’t be the best performance to beginners because it must be without any point and use. However, there are some ways that you can have benefits from Ajax. Firstly, no need to cut off all Ajax requests; best way is to cut off the wasted or unimportant. Being aggressive you can also cut the less important requests.
Var changed= false;
The next way to increase the number of requests performed is that you have to take advantages from browser catching.
Use GET Requests When Require
GET request is tending to perform best than POST whenever you are speaking of GET request types. The decision that is used by you must be based upon the specific parts of the requests. Like the GET requests are intended to have information from the server. Secondly, POST requests are intended to cause a server reaction, same like the updating of database record and sending email. But most often they GET requests are faster.
Reduce the Amount of Data Transmitted
- Plain text
- extensible Markup Language (XML)
There are some other factors to select a data format, but here the plain text will transfer the lowest bits of data. JSON and XML are good in representing complex data and plain text should not be as an optional or option.
To reduce the number of requests performed and the amount of data included in both sides of transaction is full of dramatic impact on your Ajax performance. When you want to have server changes on to order to provide help so some codes that you have in control base on considerations, you have to know before any reaction. First, you need to be vigilant about creating and ending XML HTTP request object at optimal times. Simple example bases on auction site that can perform two types of Ajax requests.
- Submission of new auction bids
- The retrieval of updated auction bids
Secondly, some users will view without bid auction so the XMLHTTP request object to perform bids, won’t initialize. After the user submit a bid for the first time then it will initialize. The XMLHTTP requests object are kept alive if auction remains open, on the other hand if the auction closes so both will be destroyed.