Changing Cache Store

SupportPal uses a file-based cache store to keep regularly requested data readily available and reduce the number of database calls. The used cache store can be changed to other available stores.

Contents

Available Cache Stores

The below cache stores are only available on Linux:

Updating Configuration

Below is an example of updating the configuration to use Memcached.


    <?php

    return [

        /*
        |--------------------------------------------------------------------------
        | Default Cache Store
        |--------------------------------------------------------------------------
        |
        | This option controls the default cache connection that gets used while
        | using this caching library. This connection is used when another is
        | not explicitly specified when executing a given caching function.
        |
        */

        'default' => 'memcached',

        /*
        |--------------------------------------------------------------------------
        | Cache Stores
        |--------------------------------------------------------------------------
        |
        | Here you may define all of the cache "stores" for your application as
        | well as their drivers. You may even define multiple stores for the
        | same cache driver to group types of items stored in your caches.
        |
        */

        'stores' => [
            'memcached' => [
                'driver'  => 'memcached',
                'persistent_id' => '',
                'sasl' => [
                    '', // Username
                    '', // Password
                ],
                'options' => [
                    // Memcached::OPT_CONNECT_TIMEOUT  => 2000,
                ],
                'servers' => [
                    [
                        'host' => '127.0.0.1', 'port' => 11211, 'weight' => 100
                    ],
                ],
            ],
        ],

        /*
        |--------------------------------------------------------------------------
        | Cache Key Prefix
        |--------------------------------------------------------------------------
        |
        | When utilizing a RAM based store such as APC or Memcached, there might
        | be other applications utilizing the same cache. So, we'll specify a
        | value to get prefixed to all our keys so we can avoid collisions.
        |
        */

        'prefix' => 'supportpal',
    ];

Redis Configuration

Redis is available for both Linux and Windows, and offers similar performance and functionality to memcached. That being said, the configuration process within SupportPal is slightly more complex as it requires editing a couple of other files - the below steps will guide you through the process.

For information on how to download and install Redis, please visit: https://redis.io/download. Once you have Redis successfully installed, follow the below steps to configure it within SupportPal:

  1. Make sure your PHP configuration doesn't have any disable_functions listed. You can check this via Utilities > PHP Information within the operator panel, but please also ensure your PHP CLI (cron) configuration also has the same setup.
  2. Add your Redis connection information to /config/production/database.php (don't edit your MySQL configuration):
    
                <?php
    
                return [
    
                    'connections' => [
    
                        'mysql' => [
                            ...
                        ],
    
                    ],
    
                    'redis' => [
                        'client' => 'predis',
                        'default' => [
                            'host'     => '192.168.1.150',
                            'port'     => 6379,
                            'database' => 0,
                        ],
                        'session' => [
                            'host'     => '192.168.1.150',
                            'port'     => 6379,
                            'database' => 1,
                        ]
                    ],
    
                ];
            
  3. Change /config/production/cache.php to 'default' => 'redis' (as instructed above in Updating Configuration)