For infrequently modified data, to ensure real-time update, but also to ensure speed as far as possible, how to deal with?

has a piece of data, and the query is a little time-consuming.
but this data is not updated frequently. I wanted to be written in the foreground or with cache or sessionstorage , but to make sure that updates in real time every time I modify it in the background.
is there any way to deal with it?

Jun.12,2022

you can learn about http negotiate cache and set Last-Modified or Etag. The
request will first verify whether the cache (data) has expired. If not, use the local browser cache, otherwise use the new data returned by the backend
this requires the backend personnel to cooperate with
link description

.

Link description


the backend needs to update it in real time every time it is modified. Then you should websocket


feel that it makes the processing of the backend a little more convenient. The query results are saved separately. After each modification, the query results are updated, and the front end reads the query results directly.


use the cache. When the background modification operation ends, clear the server cache with code

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-1b3dfb3-2c3f3.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-1b3dfb3-2c3f3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?