0

Due to slow issues on my website my webhoster recommands me to use memcached instead of filesystem. So I want to switch from filesystem cache to memcached on my laravel app.

I change in my .env file from this :

CACHE_DRIVER=file
SESSION_DRIVER=file
SESSION_LIFETIME=525600
SESSION_SECURE_COOKIE=true
QUEUE_DRIVER=sync

to this :

CACHE_DRIVER=memcached
SESSION_DRIVER=file
SESSION_LIFETIME=525600
SESSION_SECURE_COOKIE=true
QUEUE_DRIVER=sync

and my config/cache.php :

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

    'stores' => [

        'memcached' => [
            'driver' => 'memcached',
            'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
            'sasl' => [
                env('MEMCACHED_USERNAME'),
                env('MEMCACHED_PASSWORD'),
            ],
            'options' => [
                // Memcached::OPT_CONNECT_TIMEOUT  => 2000,
            ],
            'servers' => [
                [
                    'host' => env('MEMCACHED_HOST', '127.0.0.1'),
                    'port' => env('MEMCACHED_PORT', 11211),
                    'weight' => 100,
                ],
            ],
        ],
],

I clear the configuration cache.

How can I check if the cache system is correctly running with memcached and not still with filesystem?

I'm new to caching so can you be as clear as possible please?

Thanks ;)

Petitemo
  • 85
  • 2
  • 10

1 Answers1

0

I'm new too :) You can telnet and see the list of keys in memcached.

Read more here

Enjoy!