You are here: Re: Page load frequency « PHP Programming Language « IT news, forums, messages
Re: Page load frequency

Posted by Erwin Moller on 12/13/06 14:03

frizzle wrote:

> Hi there,
>
> I need a function to prevent a page from being loaded too often too
> fast.
> So say, one is only allowed to refresh a single page 5 times in 10
> seconds, or 10 times in 5 seconds (or whatever ... ).
> If the load frequency exceeds that, the site calls exit(); And a
> message is displayed. Just like Expression Engine does ...
>
> This way i want to protect the DB from being queried rediculously
> often, and maybe even protect it from DDOS attacks.
>
> I hope it's clear. I don't know where to start ..
>
> Thanks!

Hi,

You have to implement some kind of countingmechanism when the page starts.
You can store the timestamp (now) in a database once the page runs, and
check if it has been accessed more than X times last Y seconds.
Just build it. :-)

Of course this check will slow down each request to the page a little, but
if the load of running the whole page is much higher, this may be worth the
time.

Regards,
Erwin Moller

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация