Dunno. You might actually *want* SE traffic... I use:

private ERXExpiringCache<String, Number> ips = new ERXExpiringCache<String, Number>(60L * 60L);

    public WOSession createSessionForRequest(WORequest worequest) {
        WOSession session = super.createSessionForRequest(worequest);
boolean isRobot = ERXBrowserFactory.factory ().browserMatchingRequest(worequest).isRobot();
        if (!isRobot) {
            String remote = worequest.headerForKey("remote_addr");
            if (remote != null) {
                Number cnt = ips.objectForKey(remote);
                if (cnt == null) {
                    cnt = new Integer(0);
                }
                cnt = cnt.intValue() + 1;
                ips.setObjectForKey(cnt, remote);
                if (cnt.intValue() > 5) {
                    isRobot = true;

                    log.debug(remote + "\n" + ips + "\n" + worequest);
                }
            }

        }
        if (isRobot) {
            session.setTimeOut(60);
            session.setStoresIDsInCookies(true);
            session.setStoresIDsInURLs(false);
log.info("Created spider session: " + worequest.headerForKey("user-agent"));
        } else {
log.info("Created non-spider session: " + worequest.headerForKey("user-agent"));
        }
        return session;
    }

Which shortens the livespan of robot requests quite a bit. Robot here = either in the Wonder blacklist or more than 5 sessions from the same IP in one hour.

Cheers, Anjo

Am 22.01.2009 um 22:34 schrieb Pascal Robert:


1. Block the offending source. Reduce the session timeout so the session go away more quickly.

And to do that, look at Apache's log.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-deploy mailing list (Webobjects- dep...@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-deploy/anjo% 40krank.net

This email sent to a...@krank.net

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-deploy mailing list      (Webobjects-deploy@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-deploy/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to