What is Memcache?

Memcache is basically is a generalpurpose distributed memory caching system.

it allows you to store any form of data in a ‘temporary cache’ so wherever you go to do a database query, instead of just connecting to the database and getting the data we want we first check the memcache to see if our data is already stored. If the memcache returns nothing, then go to the database, get what you’re looking for, then store it in the memcache

There are five main functions that we use with Memcache and they are as follows:

get() – gets the value for a specified key

set() – sets a given key with a given value

add() – adds to the cache, only if it doesn’t already exist

replace() – sets in the cache only if the key already exists

flush() – removes all keys and cached data


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s