Should I limit ajax requests?

Are ajax requests more resource-intensive than a normal page load?

For example, I have a simple menu with normal links (when you click on the link you get on a page).

With ajax, I can prevent this behaviour on click and request the link's href with ajax (GET), then get the html I want from the results and insert it in the current page. Does this use more resources than the normal link behaviour?


I would use ajax requests only if you want to add enhanced value to the page, by changing the look/functionality after the user has interacted with the page.

It probably doesn't necessarily use more resources than just clicking on the link, but it is definitely faster for the user because it doesn't need to reload all the other content on the page as well.

Most of it has to do with the type of experience you are trying to deliver.

I would try both as an experiment and see which feels better to you!

No, it doesn't use any more resources on the server. On the client, it's possible to write inefficient code but that would be a fault of how you load pages, not the actual downloading of the page itself.

No extra server resources are required to deliver the content. Take a look in firebug / fiddler / charles. From the server's POV, the requests are identical.

If implemented right AJAX can cause less server load than normal page requests. If you just serve a data request (a little JSON array incoming and outgoing) you do not typically need to instantiate the whole CMS. Simpler handler scripts often suffice.

In your case it sounds like you are just using $("#link").load("frompage.php #link") or something. In which case it makes no difference.

(Request limiting is sometimes advisable for security reasons, or preventing complete database scraping. Not applicable in your case.)

Need Your Help

Want to add image to aspx rss page

c# .net rss xmltextwriter

I have a cod where my aspx.cs file writes to an aspx the xml tags.

StreamReader ReadLine Memory Leak

c# memory tcpclient tcplistener

I am making a server and I've noticed it has a bit of an odd memory leak. On my server, I have limited the total connections that one IP address can make to 8. This works perfectly.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.