Skip to content

Distributed Caching

mayank jaglan edited this page Feb 3, 2017 · 22 revisions

A distributed cache is an extension of the traditional concept of cache used on a single machine. A distributed cache may span multiple servers. It is mainly used to store app data and web session data.

Choice of System

For laravel portal, the choice of distributed cache is between memcached and redis. The usage of caching is considered for small and static data (mostly only for read purpose). While redis is more versatile in usage, it is also a consideration for us - as part of comparative study.

PHP5-Memcached

Approach is to configure php5 driver with memcached. Writing php script to add forever existing cache variable in

Route::get('/', function () {
    return view('welcome');
});

and later reading it on the landing page. Re-attempting reading same variable when one instance is down.

Clone this wiki locally