我一直在阅读有关实现命中计数器的各种方法。我最喜欢的是为特定用户设置会话/cookie 标志,以指示他/她是否访问了特定页面。如果未设置标志,我将设置它并将页面的点击数增加 1。
I know the above method is fine, but I also understand that it will always have a workaround. But if I use a dedicated table with a unique constraint on a combination of page_id and ip_address, it should work most efficiently when used with a combination of a session flag. But considering the site I am working on has about a 20000 hits a day (which isn't a lot, but enough to flood my hits table), is it worth flooding MySQL with ip addresses just to capture hits?
Also, is there a better way of capturing legit hits other than these?