R
R
Roquie2015-01-24 18:52:26
PHP
Roquie, 2015-01-24 18:52:26

How to cache data that is frequently updated?

Those data with which the user works directly interacting with ui is understandable.
How to cache the data that you need to know in real time?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
IceJOKER, 2015-01-24
@IceJOKER

That is, you want to cache realtime data? - some kind of contradiction, don't you think?
That is, a person should see the realtime update, but at the same time this data should be cached. O_O
And so - you can only update the area with which the user works with ajax.
Or you can save the whole page to a file and, depending on the time, either update or issue a cache.
Or save in the database (in my opinion not a good idea)

V
Vitaly Vitaly, 2015-01-25
@V_Tjuryakin

If I understand correctly, about real-time, you mean that the user receives data from the server (no matter how: sockets, ajax, etc.) and on the server this data needs to be cached - until new ones appear?
In this case, it is necessary:
​​1. When fetching data that is sent in real time, check if there is an object in the cache.
2. In the place where the data is updated - overwrite the value in the cache with the new object.
Everything seems to be so standard.

P
Puma Thailand, 2015-01-25
@opium

Well, just like not quickly updated data, I don’t really understand what is your problem with caching them?:

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question