1 year ago
#364917
wrx03ppp
Problems with Ajax calls on a shared server
I've a web site with one particular page that has worked well for a few years but my host has recently moved me to a new server which is a shared platform. I don't understand the details of the differences between the old and new servers and the provider is not readily providing information. Before I jump ship and find a new provider I thought I'd ask for any ideas as to how I might get the page working again.
The issue is that I'm using Ajax calls to populate and manage a folder hierarchy. The web page user clicks on a folder and it opens to show other folders or items. Absolutely straight forward and just the same as browsing folders and files on a PC. Depending on the type of folder or item the user has clicked on, further Ajax calls are used to retrieve information and images about that folder or item. As you can imagine, the rate at which Ajax calls are sent depends entirely on how quickly the user clicks around the page and very swiftly a tool called Mod Security decides it must be a bot doing all this clicking and the whole thing comes crashing down. It has worked fine on the old server but I'm wondering if there's a way to make it work again on a shared platform.
The reason I'm using Ajax calls is to fetch the information from an SQL DB and I wanted to keep this "server-side".
So, my question is whether or not there are any alternative approaches I can employ to request data from the DB that might work in this situation? I've been looking around and am a bit baffled as, although I have been a software developer for many years, I'm not an experienced web developer. I thought web sockets might be ok but it seems these are also problematic on a shared platform. I could queue up the Ajax requests and dispense them at a controlled rate but this would likely make the user experience a bit of a bore. Alternatively, if there's a way to do the SQL client-side but restrict the access to the DB.
Any ideas would be much appreciated.
php
sql
ajax
mod-security
0 Answers
Your Answer