What to use instead AJAX

###Username: epiz_31677333

I am asking about free account.

Note that I am new to all of this and I am still learning. I want a dynamic page, meaning data would refresh without reloading page. I read on other forums, AJAX would be good to use for this. But after reading some topics here (especially this How to use AJAX) I see that too much AJAX (how much?) would result in suspended account. Since I do not want to do this, is there any other option beside AJAX? And how to load PHP data without reloading page that would not result in account suspension?

2 Likes

In general, every request made from a visitor’s browser that hits a PHP script on the server uses some server power. Server power is a finite resource, so we limit how much you can use. And since we provide a free service, the limits are not very high.

The question “how much AJAX is too much AJAX” is impossible to answer for all sites. It really depends on how your website was built, how many people use it, and how often you query the server.

You’re free to use AJAX on your website. Just don’t try to host an application that rapidly polls the server for updates, like a chat script, with us, because you’ll quickly hit limits.

As to what you should do instead, it really depends on what you’re looking to do in the first place. Could you please explain a bit more about what you need so we can advice?

3 Likes

Thanks! Well, I think I will be OK. I am planing to do website for competition (Eurobasket and FIFA world championship) that only family and close friends will use - max 30 users.

I am planing to do some competition table that will update score on hourly basis, but PHP will be puled when user wants. I think, due to number of users, I will be good and will not exceed limits.

As in, people will have a button to refresh the status in the background? That will probably be fine.

4 Likes

Yes, they will need to press button/select team/ etc… they will need to do something it will not be automatically.

I should also note that it is possible for this to be abused.

Like admin said, it is impossible to answer “how much AJAX is too much AJAX” for all websites. This is especially true because some websites are more susceptible to vulnerabilities than others. If users can request a resource, this can easily be abused accidentally (truly malicious people could simply request a resource outright, but some people might not know about hits and would request resources too much without knowing the damage it causes).

Adding a limit to how many requests it makes would be a good idea.

Also, you might also want to use the fetch API since it offers more simplicity, but XMLHTTPRequest is perfectly fine as well, albeit somewhat more complicated.

3 Likes

How can you do that? Since this is first time I am hearing about this option, can you please share more about it - just general ways so that I can google more about this?

After reading about fetch API, it looks promising. But for learning and understanding I will (for now) go with XMLHTTPRequest. But will definitely use fetch API in latter projects.

1 Like

This?
https://docs.appdynamics.com/22.1/en/end-user-monitoring/browser-monitoring/browser-real-user-monitoring/configure-the-javascript-agent/set-the-number-of-ajax-requests

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.