Latest web development tutorials

Memcached gets command

Memcached gets order to obtainvalue (data value) stored with the CAS token, if the key does not exist, it returns null.

grammar:

The basic syntax gets command is as follows:

gets key

A plurality of key separated by a space, as follows:

gets key1 key2 key3

Parameters are as follows:

  • key: key key-value structure key, it is used to find the cache value.

Examples

In the following examples, we use w3big as the key, set the expiration time of 900 seconds.

set w3big 0 900 9
memcached
STORED
gets w3big
VALUE w3big 0 9 1
memcached
END

Using the output of the command gets results, at the end of one of the number 1 represents the key for the w3big the CAS token.