--- daemon connect status: connected (memcache daemon is running) ---
--- key 3006 retrieved from memcached ---
--- value is: brisg2.jpg Gauge Point, Bristol ---

Caching database queries in memory in PHP


Gauge Point, Bristol
If you have a busy server with repeated database queries, you may wish to use the memcached daemon. This service allows you to store a query's results in memory (and even to share the cache between computers) so that you don't have to keep repeating SQL and disc accesses.

Memcached is used on many very busy sites - it's ideal for blog articles (where the recent ones will be cached), images, and so on.

This is a demonstration of memcached in use, via a PHP web page. It's provided by Well House Consultants who cover such topics on their PHP techniques workshop or on private courses.

You are also very welcome to view the source code (link below) and read a little more about it in our blog here.

The home page of memcached is here.


Training sample © 2010, WELL HOUSE CONSULTANTS LTD
This is http://www.wellho.net/demo/cademo.php
See source code here • More examples - same topic here
Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
Phone: +44 (0) 1225 708 225 • EMAIL: info@wellho.net • WEB: http://www.wellho.net