Configuration

You can add the following options to your site's config.php file. For example, $config['speedy_driver'] = 'redis';

The following are optional:

  • 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: "yes")

  • speedy_driver The default driver to use if one is not specified on the module tag. (Default: "dummy")

  • speedy_enabled Set this to no to disable Speedy completely. (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_whitelist Add an array of $_GET keys that are valid when caching a static page (Default: [])

  • 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)

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',
]
],
];

Debugging

You can put Speedy into debug mode, which will output some additional information as html comments in your cached output. To enable debugging, just add ?speedy_debug=1 to any page request. Note that this currently only works with Static caching.