What would be a good way to deal with receiving duplicate HTTP requests on the server?
I have reports on a LAMP web app which take ~ 30 seconds to build on the server and return to the client. Clients get impatient and run the report again before the first finishes. This bogs down the server. Is there any way to handle/prevent this server side?
Store the fact that a job is already running somewhere.
In your code that generates the report, check if one is already running. If so, don’t run another.
When the report is done generating or some timeout expires to handle exceptional conditions, un-store that fact.
You can use a database, a memcached server, redis, a text file, write to shared memory…