Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Preventing multiple requests for the same file?

Recently one of my websites has been getting hit hard by (usually) short periods of time where there are multiple requests for the same file from the server. It's always an image file, and it's usually from the same range of IP addresses. I'm talking upwards of 100 requests a second. It kills my bandwidth and renders the server completely inaccessible until it stops.

I'd ban the IP range, except that it's coming from the local college campus, which is the site's primary audience... so unfortunately that course of action just isn't feasible.

I've try hunting around for solutions, and have found several requests for help with similar problems. Unfortunately, none of them had much in the way of advice. Any ideas?

2 Answers

Relevance
  • Anonymous
    1 decade ago
    Favorite Answer

    Interesting problem, but I have no straight answer either. If there is a way, it would be at the server itself, in the root of Apache (if it is a lamp server).

    As the server receives the request, it also receives the IP address of the "asker". If a second request for the SAME page comes from the SAME IP, a small piece of code could and would just discard the request (for a certain period, of course). This means writing a piece of code in the server language and "include it" somehow in the function that respond to the requests... Not an easy task, but probably easy enough for a Unix type programmer who manages the server(s).

    Source(s): Pro web2 application developer at www.web2coders.com
  • Anonymous
    1 decade ago

    100/sec? I'd work on the IP range and, if it's narrow enough, block it. Then, when you get a complaint, you'll know who's doing it, and why.

Still have questions? Get your answers by asking now.