Configuration

The minimum recommended settings for your config.php file:

$config['speedy_enabled'] = 'yes';
$config['speedy_driver'] = 'file';

The following are optional:

Optional Configuration

The following list of $config options are all set to the recommended values by default. You can change them based on your site's needs.

speedy_block_bots

Check the user agent and prevent caching items when a bot is detected. (Default: "no")

speedy_break_async

Attempt to break the cache asynchronously when possible. (Default: "no")

speedy_diagnostics_enabled

Diagnostics are enabled by default. Set this to no to disable diagnostics. (Default: "yes")

speedy_driver

The default driver to use if one is not specified on the module tag. (Default: "dummy" Options: (dummy|database|file|redis|static|memcache|memcached) You can only have 1 driver set to default at a time.

speedy_enabled

Set this to no to disable Speedy completely. (Default: "yes")

speedy_enable_refresh

If set to no will not attempt to refresh any of the cached items, thus no cURL requests behind the scenes to try to re-generate cached items, which can take time depending on the size of the site. (Default: "yes")

speedy_exclude_404s

Set this to no to cache pages that result in a 404 error. (Default: "yes")

speedy_ignore_post_requests

Set this to yes to prevent POST requests from being cached. (Default: "no")

speedy_logged_in_only

Prevent caching items when the visitor is logged in. (Default: "no")

speedy_logged_out_only

Prevent caching items when the visitor is logged out. (Default: "no")

speedy_query_cache_allowlist

Add an array of $_GET keys that are valid when caching a static page (Default: []), In of version 1.2 of Speedy speedy_query_cache_whitelist was renamed to speedy_query_cache_allowlist

speedy_refresh_curl

Set this to no to disable cURL drivers when refreshing the cache. (Default: "yes")

speedy_refresh_async

Attempt to refresh the cache asynchronously when possible. (Default: "yes")

speedy_refresh_exec

Set this to no to disable exec drivers when refreshing the cache. (Default: "yes")

speedy_refresh_interval

The number of seconds to sleep between refreshing cache items. (Default: 0)

speedy_secret

A secret passphrase used to authenticate request to ACTion urls. (Default: "")

speedy_static_path

The path to the static file cache directory. (Default: DOC_ROOT . "/static")

speedy_static_enabled

Set this to yes to enable the static file cache. (Default: "no")

speedy_ttl

The default TTL in seconds to use if one is not specified on the module tag. Set this to 0 to cache items until the cache it broken. (Default: 3600)

Driver Configuration

Speedy has some drivers that are configurable, thus they require extra configuration. The Redis and Memcached drivers require server connections. All configurable drivers have a control panel page to manage their settings, however, you can also manage those settings in your config.php file. Below are examples of config file overrides for the Static and Redis drivers.

The Static driver does not have configuration, other than speedy_static_path and speedy_static_enabled, but you may choose to define some url paths that are to be ignored when caching. Note that ignores can be valid regular expressions.

$config['speedy_static_settings'] = [
    'ignore_urls' => [
        ['url' => 'invalid/page'],
        ['url' => '^[a-z]{2}/products'],
        ['url' => '^products/.*'],
    ],
];

The Redis driver has additional configuration to manage it's connection to the Redis server. Note that Speedy currently only supports 1 Redis server.

$config['speedy_redis_settings'] = [
    'static' => 'yes',
    'servers' => [
        [
            'host' => '127.0.0.1',
            'port' => '6379',
            'timeout' => '0',
            'password' => null,
        ]
    ],
    'ignore_urls' => [
        ['url' => 'invalid/page'],
        ['url' => '^[a-z]{2}/products'],
        ['url' => '^products/.*'],
    ],
];

Similarly, the Memcached settings can be managed in your config file as well.

$config['speedy_memcached_settings'] = [
    'persistent' => 'yes',
    'servers' => [
        [
            'host' => '127.0.0.1',
            'port' => '6379',
            'weight' => '0',
        ]
    ],
];

Last updated