Set is most used command in Memcached. Its store data. If the data exists it will be over written. New data is always added at the top of the LRU. LRU means Last Recently Used. Syntax of the set is like below.
set key flags expiretime size
Now we will add and url with set operation.
set poftut 1000 4
- set is the operation
- poftut is the key to find data
- 0 is the flag so there is no flag
- 1000 is the seconds to hold value in Memcached. After that value is deleted
- 4 is the size of the value
- test is the value we want to save
- STORE means it is saved successfully
Let’s check the value we have saved. Keep in mind that we have 1000 seconds to check after that time the value will not exists.
VALUE poftut 4