How to use Memcached with PHP

Memcahced open source distributed memory object caching system it helps you to speeding up the dynamic web applications by reducing database server load. In this post I want to explain how I had implemented Memcached object caching system for Database. All the popular site which have a higher traffic like Facebook, Twitter uses Memcache for faster page load.

Sample database demos table contains id, title and link.

First User Request
First request goes to database server at the same time data object storing in Memcached server.

How to use Memcached with PHP
Second User Request
Second user request data comes from Memcached object.

How to use Memcached with PHP

Contains PHP code.

You have to change hostname, username, password and database name.

About the Author: Sanjeev Kumar

Experienced PHP Web Developer and founder of www.codemarts.com. Expert in Codeigniter (MVC), WordPress, JSON, jQuery & HTML5.

Leave a comment