I do not think this is possible. It would require to know the order of the logs for each cache that might qualify for this challenge. This means that for every cache that might fulfil the criteria all logs need to be retrieved (at least up to the find of the user), which would be quite heavy on the database (if it is possible at all).