开发者

excessive dependence on ajax

I am a newbie to web development. I am trying to develop a web site and it uses fairly large number of ajax requests. In between i came across a friend who said that excessive dependency on ajax request can be a performance concern and makes the browser to utilize huge amount of network utility and cpu usage. Is this true..?

Does excessive d开发者_JAVA百科ependency on ajax pose serious performance issues.?


If you are using a lot of Ajax requests, you are going to want to do some things to speed up your application

1) Make the server as fast as possible by using caching, returning limited sets of data, etc.
2) Make sure you actually need every ajax request. For example, you can wire a select box up to an ajax response, but if the data rarely changes, maybe you should load it only once, when the user loads the app.
3) Dont load too much data -- loading a table with 1000 rows in it via ajax can take a while, both to get the data and to render the response. If possible, use paging or similar techniques to get the request size down.

Any ajax enabled site can have usability issues if the network is slow, if the server is slow, if the browser is slow. This is just part of the game, and the fun and joy of modern web development. Do what you can to mitigate these types of issues.

Asking if you can have excessive dependency on ajax is kind of like asking if you can have excessive dependencies on 'divs'. Ajax is a tool, and like all tools, there are ways to use it properly.


No. If you'd have to reload the whole page every time you make an ajax request, you would need much more cpu time and network traffic. Though, if you use ajax to reload the clock in the status bar every second from the server, you should replace this with a javascript function...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜