devicemap-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Volkan YAZICI <volkan.yaz...@gmail.com>
Subject Handling Bots and HTTP Clients
Date Tue, 09 Dec 2014 12:34:05 GMT
Hello,

In the context of discussion "how do we handle HTTP clients", I would like
to vote for treating them as bots. Further, I want to propose adding a thin
layer above DeviceMapClient.classify() to make a shortcut for handling of
the bots as follows.

private final static Map<String, String> botAttributes =
Collections.singletonMap("is_bot", "true");

public Map<String, String> classify(String userAgent) {
    if (isBot(userAgent)) return botAttributes;
}

The motivation for this change is as follows:

   - Almost all of the attributes are making no sense for a bot and we are
   losing time to match it against the whole DDR.
   - Bot database will be able to evolve independently.
   - We can come up with a single compiled j.u.regex.Pattern to check bots.
   (I am pretty sure Reza knows a lot better performing approaches, but maybe
   for a future release.)

If the development team is ok with that, I want to implement this feature.

Best.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message