网上看一篇文章或者其他的时候总会看见被浏览了几次开始以为是点击一个链接这个次数就会加一,但是有的重复点击就不会加,这是怎么实现的呢?
天蓬老师2017-04-18 10:35:04
Do you want to implement this function yourself? If you want to implement this function yourself and the statistics are as accurate as possible, then build a click table for each article, record the information of visiting users in the table, and then compare the conditions every time a user clicks. If you want performance, put this data in an in-memory database such as redis.
PHPz2017-04-18 10:35:04
Remove weight? It can be judged based on the user account, IP, and cookie, depending on the needs
伊谢尔伦2017-04-18 10:35:04
Do it through the backend. I did not remove duplicates. I directly accessed it once and gave pv+1 and then wrote it to the database. When the article opens the page and makes a get request, it can be read directly.