Please note, this is a STATIC archive of website www.javatpoint.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
Javatpoint Logo
Javatpoint Logo

Memcached - Get Data

Memcached get command is used to retrieve the value stored at key. This command takes one or more keys and returns all found items. If the key does not exist in Memcached, then it will return nothing.

Syntax

Here,

key: It is the key data stored and retrieved from Memcached.

Example in Ubuntu

Let's see an example for "get" command. Here, we will use 'city' as the key and store 'bangalore' in it with expiration of time 900 seconds.

Memcached - Get Data

Example in Windows:

Let's see an example for "get" command. Here we will use 'city' as the key and store 'bangalore' in it with the expiration of time is 900 seconds.

Memcached Server:

Memcached - Get Data

Memcached Client

Memcached - Get Data

Get data using Java Application

Consider that Memcached server is running on host 127.0.0.1and port 11211. Here, we will use get() method to get data in Memcached server.

Example

Output:

Connection to server successfully
set status: true
Get from Cache:bangalorebangalore






Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA