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.
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.
PV & UV
This is based on the user’s unique client
Using cookies, I forgot about it! ! !
There are specialized statistical tools, like Baidu Statistics
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.
Remove weight? It can be judged based on the user account, IP, and cookie, depending on the needs
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.