Lars Kjeldsen
Lars Kjeldsen

Reputation: 25

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

Upvotes: 1

Views: 296

Answers (2)

Kenneth Ito
Kenneth Ito

Reputation: 5261

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.

Upvotes: 1

Brandon J. Boone
Brandon J. Boone

Reputation: 16472

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.

Upvotes: 0

Related Questions