在共享服务器上呼叫AJAX的问题
我有一个网站,其中一个特定页面已经运行良好几年了,但我的主机最近将我转移到了一台新服务器,这是一个共享平台。我不了解新旧服务器之间差异的详细信息,并且提供商也不愿意提供信息。在我跳槽并寻找新的提供商之前,我想我会询问有关如何使页面再次运行的任何想法。
问题是我正在使用 Ajax 调用来填充和管理文件夹层次结构。网页用户单击一个文件夹,该文件夹将打开以显示其他文件夹或项目。绝对简单,就像在 PC 上浏览文件夹和文件一样。根据用户单击的文件夹或项目的类型,进一步的 Ajax 调用用于检索有关该文件夹或项目的信息和图像。正如您可以想象的那样,Ajax 调用的发送速率完全取决于用户在页面上单击的速度,并且很快,一个名为 Mod Security 的工具就确定它一定是一个机器人执行所有这些单击操作,然后整个事情就崩溃了。它在旧服务器上运行良好,但我想知道是否有办法让它在共享平台上再次运行。
我使用 Ajax 调用的原因是从 SQL DB 获取信息,并且我想保留此“服务器端”。
所以,我的问题是是否有任何替代方法可以用来从数据库请求数据,在这种情况下可能有效?我环顾四周,有点困惑,因为尽管我已经成为软件开发人员多年,但我并不是经验丰富的 Web 开发人员。我认为网络套接字可能没问题,但似乎这些在共享平台上也存在问题。我可以对 Ajax 请求进行排队并以受控的速率分配它们,但这可能会让用户体验有点无聊。或者,如果有一种方法可以执行 SQL 客户端但限制对数据库的访问。
任何想法将不胜感激。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论