in reply to Re: Website Statistics
in thread Website Statistics

I see what you mean that checking against all IP's could get really slow. I doubt I would run into that problem since my site is small. However, perhaps a comprimise would be to store the last 20 or so IPs just so I don't count people hitting refresh and more hits.

Replies are listed 'Best First'.
Re: Re: Re: Website Statistics
by CountZero (Bishop) on Jun 02, 2003 at 15:10 UTC

    I don't think that checking the IP of the present visitor against all IP's which have already visited your site would get really slow.

    The only way to get a value for unique IP's which have visited your site is by putting the IP-numbers which have visited you in a database.

    Something like MySQL is probably the fastest solution although you could do it easily with any type of database which has a DBI/DBD interface.

    Checking and updating your database will be very fast as you can index on the field containing the IP. If you run it under Apache and mod_perl, you can even have persistent database connections so you save on the connect/disconnect overhead and the script stays "compiled" in between hits.

    Whether the values you obtain have any meaning is altogether another issue as there is no sure-fire way to link IP's to people.

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law