Given a controller action test() as defined below. I can access the request and get the IP as well as the user agent. I want to count the number of requests that access test(). This is easy, I would just increase a counter on every request.
My question is how can I count the unique requests? I.e., I want to count a request coming from the same computer only once. Is there another way than storing all the ip addresses and user agents to see if they already occurred?
def test() {
println "ip: "+request.getRemoteAddr()
println "user agent: "+request.getHeader("User-Agent")
}