Getting content: AJAX vs. "Regular" HTTP call Getting content: AJAX vs. "Regular" HTTP call ajax ajax

Getting content: AJAX vs. "Regular" HTTP call


If you want people to be able to bookmark individual pages, use HTTP requests.

If you are changing context, use HTTP requests.

If you are dividing functionality between different pages for better maintainability, use HTTP requests.

If you want to maximize your page views, use HTTP requests.

Lots of good reasons to still use HTTP requests - Stack overflow is a wonderful example of those divisions between AJAX and HTTP requests. Figure out why each function is HTTP or AJAX and I'm sure you will derive lots more reasons when to use each.


My simple rule:

Do everything ajax, especially if this is an application not just pages of content. Unless people are likely to want to link to direct content, like in a blog. Then it is easier to do regular full pages.

Of course there are many blended combinations, it doesn't have to be one or the other completely.


A fair amount of development overhead goes into partial-page reloads with AJAX. You need to create additional javascript handlers for all returned data. If you were to return full HTML blocks, you would still need to specify where the content should go and whether or not it's replacing other content. You would potentially have to re-render header tags to reflect content changes and you would have to implement a history solution to make sure search engines can index each page (using SWFAddress jQuery plugin, for example). If you return JSON encoded data you have an additional processing step.

The trade-off for reduced bandwidth usage by not using a page refresh is offset by an increase in JS code and event bindings which could affect page rendering speed as well as visual effects.

It all really depends on your target audience and the overall feel you are trying to go for on your page. AJAX and preloaders are flashy, and people love flashy things. If you believe the end-user experience will improve by adding partial page loads by all means implement them.