Multiple AJAX calls - single aspx page or multiple aspx pages for better performance

I am currently rewriting a large website with the goal of replacing a large number of page/form submittals - with AJAX calls. The goal is to reduce the amount of server roundtrips - and all the state handling on pages that are rich with client .

Having spent some time considering the best way forward with regards to performance - my question is now the following.

Will it lead to better performance to have just one single aspx page that are used for all AJAX calls - or will it be better to have a aspx page for every use of AJAX on a given webage?

Thank you very much for any insights

Lars Kjeldsen

Answers


Performancewise either approach can be made to work on a similar order of magnitude.

Maintanancewise, I prefer to have separate pages for each logical part of your site. Again, either can work, but I've seen more people make a mess of things with "monolithic" type approaches. Single page you'll need a good amount of skill structuring your scripts and client side logic. Well done there isn't a problem, however, I just see more people getting it right when they use separate pages for separate parts of the site.


If you take a look at the site http://battlelog.battlefield.com/ (you'll have to create an account) you'll notice a few things about this it.

  1. It never refreshes the page as you navigate the website. (Using JSON to transmit new data)
  2. It updates the URL and keeps track of where you are.
  3. You can use the updated URL and immediately navigate to that portion of the web-application. (In this case it returns the HTML page)

Here's a full write up on the website.

Personally, I like this approach from a technology/performance perspective, but I don't know what the impact it will have on SEO since this design relies on the HTML5 History state mechanism in JavaScript.

Here's an article on SEO and JavaScript, but you'll have to do more research.

NOTE: History.js provides graceful degradation for Browsers that do not support History state.


Need Your Help

Xcode project won't build after running Clean My Mac removed development junk files

iphone objective-c ios xcode

This Xcode project won't build after running Clean My Mac. It looks like the program cleaned out some "development junk files" and now I'm getting errors like 'Foundation/Foundation.h' not found.

How do you use matrices in Nimrod?

math matrix nimrod nim

I found this project on GitHub; it was the only search term returned for "nimrod matrix". I took the bare bones of it and changed it a little bit so that it compiled without errors, and then I adde...