X
X
xXRustamXx2020-09-14 21:59:24
Redis
xXRustamXx, 2020-09-14 21:59:24

What is the purpose of the TOUCH command in redis?

The command TOUCH is written in the dock Changes the time of the last access to the key.

What is it for? Can you give examples plz

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DevMan, 2020-09-14
@xXRustamXx

radish considers "easy" to write: how much time has passed since the last access (read or write).
the touch command resets this counter to zero.
how to use it depends only on your imagination.
for example, I'm deleting some post types that haven't been accessed for more than a certain amount of time. using touch allows me to "update" such entries without accessing them directly.

D
Daria Motorina, 2020-09-14
@glaphire

Explanation on SO
The TOUCH command can be used to extend the life of a record

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question