Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用Code Igniter. 在这个聊天应用程序中,只有一个频道/房间。我想知道存储数据的最佳做法是使用数据库还是文件以节省带宽和页面加载。
Code Igniter
ps:我javascript setInterval习惯每 x 秒加载一次聊天 div。
javascript
setInterval
如果你想要这个文件,你可以使用 reverse-ajax/comet 因为它更快并且占用更少的带宽,因为它使用长池
如果您使用数据库并使用 ajax,它会更慢,因为它总是更新数据库中的新聊天消息,从那里获取行并显示它,这需要时间,我认为更多带宽