Php – Allow only one request per ip and url

apache-2.2httpPHP

Using a htaccess file or sending special headers from php, is there any way to allow only one http request by ip and url? I mean, an user could make multiple request simultaneously, but not to the same url (file).

The issue comes with the download accelerators. I need to allow multiple dowloads at the same time and also pause and/or resume them (bc of failures in the client's connection, mainly), but disable that annoying function of having multiple partial downloads at the same time because they are making the server crash because of the amount of simultaneously requests.

Best Answer

The server should not crash because of the amount of simultaneous requests. If you are using Apache (as per question tags) try lowering (even dramatically) MaxClients and MinSpareServers or MinSpareThreads. Or also, try out nginx.