mercredi 3 février 2016

Configure Memcached in Laravel

I've tried to set up memcached with my Laravel

Set Driver

/config/app.php

'default' => 'memcached',


Configure Memcache Server

'stores' => [


    'database' => [
        'driver' => 'database',
        'table'  => 'caches',
        'connection' => null,
    ],


    'memcached' => [
        'driver'  => 'memcached',
        'servers' => [
            [
                'host' => '127.0.0.1', 'port' => 11211, 'weight' => 100,
            ],
        ],
    ]

],


Cache

Route::get('cache/users', function() {
    return Cache::remember('users', 60, function() {
        return User::all();
    });
});


How do I know I configure my caching with memcache properly ? How do I see what I stored ?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire