View Full Version : preventing floods of file requests in my site.
Hi,
Just had a thought today as my bandwidth went up to the limit :( Is there any way to limit the number of times a page can see an image in say a 24hr period? I don't want ot prevent legit viewers but, being cynical, there could be those, who might flood my site with requests for images, only to bust my bandwidth and effectively close me down.
Bazz
mlseim
02-27-2005, 12:12 AM
Bazz,
I thought that the images can only be viewed via your site?
You know, nobody can link to them or copy them.... "mask.pl"?
except the customers that are linking to them from their sites.
You'll have to determine how many customers you have,
and how often "their" sites are visited, because every
image they have is actually coming from your site.
That's the whole point of hosting the images for them to use.
Maybe with your web stats (with your webhost), you can
narrow down the actual cause of high bandwidth. Maybe
YOU are causing it now because of your troubleshooting and
development. Even your FTP transfers contribute, everytime
you make a change and re-upload a file.
Just some thoughts.
--max--
Ah yes, this proves that I'm a numptie. :rolleyes:
I was so surprised that my bandwidth was spent, that I thought it must have been from perhaps having been hotlinked automatically where they just hoovered me of bandwidth by pullijng so many images. I forgot completely about the mask script and the fact that I must firstly enable their sites.
Having then decided to take break, I noticed just how much I have been doing over the past months, which pretty well explains where the bandwidth went.
Now there are a oad of text files that I need to restrict access to, in the same way as per the photos. I expect this is possible, using the same snippet but we shall see when I am live again.
Bazz
mlseim
02-27-2005, 10:27 PM
Sometimes, for text files, I create a subdirectory in my cgi-bin
and put them in there (if I don't want people viewing them).
Nobody can view text files when they are in your cgi-bin because
when they try to open them, the Apache Perl compiler assumes
they are Perl scripts (that's what the cgi-bin is set up for).
It creates an error message.
Yet, any Perl scripts can open them and do what they want,
including displaying, reading, writing, etc.
But, as with "mask.pl", just hiding the path will do the trick.
Your Perl scripts can find them, but the people won't.
If you wanted to get into some new territory, you could look
at some "encoding" type Perl functions. Not really necessary
in your case, but it might be fun to learn.
Thanks. The text files I am referring to are not actualy suffixed with .txt. They have no suffix and they are in the cgi bin. Effectively, they are FFDb's created thru the CMS. But for other sites to use the page content, of the flat files, I want to give them links to them.
I'll look at it after the ISP fixes an issue they have which has de-activated my site. :mad:
Bazz
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.