andybest
V2EX  ›  问与答

如何设计高效的帖子的“已读”系统?

  •  
  •   andybest · Sep 1, 2015 · 1986 views
    This topic created in 3999 days ago, the information mentioned may be changed or developed.
    就如同 V2EX 首页的帖子,不断的刷新出新帖子来
    每个用户点开一个帖子后,将标记该帖子为“已读”,那么该用户再刷新首页这个帖子就在首页列表不存在了,也就是说首页仅存在用户未读过的帖子

    那么这样的数据库表结构应如何设计?首页列出最新帖子的 SQL 语句应该是怎样的?
    5 replies    2015-09-02 15:55:18 +08:00
    oott123
        1
    oott123  
       Sep 1, 2015 via Android
    你可以考虑存到 localStorage 里…
    cdxem713
        2
    cdxem713  
       Sep 2, 2015
    @oott123 然后每隔一段时间同步一次?
    oott123
        3
    oott123  
       Sep 2, 2015
    @cdxem713 同步啥……就留在 localStorage 里就好了啊
    cdxem713
        4
    cdxem713  
       Sep 2, 2015
    那别人清空一次 localstorage 自己的已读信息就被重置了?如果只存本地的话,和链接(<a>)的:visited 有啥区别。。。
    cdxem713
        5
    cdxem713  
       Sep 2, 2015
    @oott123 那别人清空一次 localstorage 自己的已读信息就被重置了?如果只存本地的话,和链接(<a>)的:visited 有啥区别。。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3122 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 13:55 · PVG 21:55 · LAX 06:55 · JFK 09:55
    ♥ Do have faith in what you're doing.