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" >
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b315c4-2bd97.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b315c4-2bd97.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?