Best practice for a local database cache?

南楼画角 提交于 2019-12-05 21:18:38

We actually run a local copy of the database and have most of the software just talk to the local database which is always available. Then we have a background process that works to keep the two databases in sync.

I will warn you that any type of local caching is not for the faint of heart. There are soooo many ways it can get out of sync. Avoid doing it if you can.

I'm not sure if this is common practice, but you could write the cached data to a JavaScript file that the client would cache. Then you can make Ajax calls to see if there have been any changes... Which would be a small request. If no changes, use the cached data.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!