On the problem of mobile front-end cache

at present, business is a very common news. App, wants to cache the news after getting the news data, and it will also cache when switching between different columns. Because I chose vue, I saved the data in vuex. Can achieve the desired effect, but if the amount of data stored more and more, there will be any problems, in addition, ask, sometimes want to let the news can be automatically updated, in this demand how to do better caching.

Mar.06,2021
The data stored in

vuex is not actually cached, and it doesn't exist when you refresh the page.
you can use sessionStorage and localStorage to save data to your local disk, which generally provides users with the ability to clear the cache.
automatic news updates can be actively pushed at the back end, or data can be pulled regularly at the front end. You can take a look at my article https://codeshelper.com/a/11.


keep-alive doesn't need to be saved in vuex.


WebSocket to learn about

when the user slides or when to trigger the update. This is the pot in the product design

< user "update" > < user "update" >
Menu