Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the basic syntax of Memcached

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "what is the basic grammar of Memcached". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what is the basic grammar of Memcached"?

Basic syntax of Memcached

Set command: command to store value values in the specified key

Set key flags exptime bytes [noreply] value

Key: key in the key value key-value structure, which is used to find cached values.

Flags: can include integer parameters for key-value pairs, which clients use to store additional information about key-value pairs.

Exptime: length of time to keep key-value pairs in the cache (in seconds, 0 means forever)

Bytes: the number of bytes stored in the cache

Noreply (optional): this parameter tells the server that there is no need to return data

Value: the stored value (always on the second line) (can be directly understood as value in the key-value structure)

Set yx 0900 9memcachedSTORED # indicates that the setting is successful; get yxSTORED: output after successful save. ERROR: output after a failed save.

Add command:

The Memcached add command stores the value (data value) in the specified key (key). If the key for add already exists, the data will not be updated (expired key will be updated), the previous values will remain the same, and you will get the response NOT_STORED.

Add key flags exptime bytes [noreply] value

Key: key in the key value key-value structure, which is used to find cached values.

Flags: can include integer parameters for key-value pairs, which clients use to store additional information about key-value pairs.

Exptime: length of time to keep key-value pairs in the cache (in seconds, 0 means forever)

Bytes: the number of bytes stored in the cache

Noreply (optional): this parameter tells the server that there is no need to return data

Value: the stored value (always on the second line) (can be directly understood as value in the key-value structure)

STORED: output after successful save. NOT_STORED: output after a failed save. At this point, I believe you have a deeper understanding of "what is the basic grammar of Memcached". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report