Support » Plugin: AVH First Defense Against Spam » [Plugin: AVH First Defense Against Spam] IP Cache Log speed

  • Resolved chaoix


    The page load of a blog with any kind of traffic with the IP Cache log on is ridiculously slow.

    Personally on my site I had the cache log set to save for 1 day and had around 3,000 entries in the IP Cache and the first time a new visitor went to the site the load time was anywhere from 20-30 seconds.

    You should probably take a look at optimizing your database queries for this. A great solution would be to add an option to only cache spam IPs for those of us who don’t use Stop Forum Spam’s API, since the amount of spam IPs to keep track will be significantly lower than the ammount of ham IPs.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author petervanderdoes


    The cache log is indexed on IP, and searched on IP. The query is just that SELECT * from ipcachelog where IP=visitingip;

    If it’s just a new visitor, it means the IP isn’t in the cache log, and the visiting IP is checked with the 3rd party. It sounds like there is a problem contacting the 3rd parties.

    Think about the massive amount of overhead you are creating before page load. The way its written now, every single page load causes a full DB query of 3000 records or more depending on the blog’s traffic.

    Might you consider using wordpress’s session handling to add a hash or something for ham visitors that skips the IP check?

    Plugin Author petervanderdoes


    Uhm, massive overhead?

    My cache log is 2791 records.

    If the IP is in the cache, the first time the cache is checked it takes about 0.0004 seconds on my server. The second check takes 0.0001 seconds as MySQL caches the first query.

    The search for an IP not in the database also takes 0.0004 seconds.

    I doubt it’s any slower than finding the ID of the post or page that needs to be displayed.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: AVH First Defense Against Spam] IP Cache Log speed’ is closed to new replies.