mardi 23 février 2016

Laravel not using memcached

I have a website with memcached installed, but Laravel seems to defaulting to the file driver.

Here's the contents of my config/cache.php

return [

...

'default' => env('CACHE_DRIVER', 'memcached'),

'stores' => [

    ...

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

    ...

],

'prefix' => 'laravel',

];

In my controller I have use Illuminate\Support\Facades\Cache; and I'm calling the cache statically, such as Cache::has($memkey).

The problem is that when I run echo stats | nc 127.0.0.1 11211 on the server it outputs

STAT bytes 0
STAT curr_items 0
STAT total_items 0

Additionally, when I look in the storage/framework/cache folder there are many files there, which have been created/accessed in the past day, which makes me think that for some reason Laravel is defaulting to use the file cache.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire