search

Home  >  Q&A  >  body text

java - 平时我们看到的文章被浏览几次是怎么实现的?

网上看一篇文章或者其他的时候总会看见被浏览了几次开始以为是点击一个链接这个次数就会加一,但是有的重复点击就不会加,这是怎么实现的呢?

巴扎黑巴扎黑2888 days ago477

reply all(7)I'll reply

  • 大家讲道理

    大家讲道理2017-04-18 10:35:04

    PV & UV

    reply
    0
  • 黄舟

    黄舟2017-04-18 10:35:04

    This is based on the user’s unique client

    reply
    0
  • 迷茫

    迷茫2017-04-18 10:35:04

    Using cookies, I forgot about it! ! !

    reply
    0
  • 阿神

    阿神2017-04-18 10:35:04

    There are specialized statistical tools, like Baidu Statistics

    reply
    0
  • 天蓬老师

    天蓬老师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.

    reply
    0
  • PHPz

    PHPz2017-04-18 10:35:04

    Remove weight? It can be judged based on the user account, IP, and cookie, depending on the needs

    reply
    0
  • 伊谢尔伦

    伊谢尔伦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.

    reply
    0
  • Cancelreply