How “View Count” is best implemented?

前端 未结 6 492
梦谈多话
梦谈多话 2021-01-30 18:07

On any website, such as on StackOverflow, each question has a view count, and user reading a question but has previous read it won\'t count twice.

I have some ideas abou

6条回答
  •  被撕碎了的回忆
    2021-01-30 18:53

    I'll try to give an answer from the functional point of view.

    count views per user - for registered users. for anonymous users - per session.

    increment view count on the first view and on any view after a significant update by someone other that the person viewing the item.

    view of poster at the time of creation should not count

    you can imagine doing it simpler too, but I've tried to think of an ideal solution.

提交回复
热议问题