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.

$config['speedy_block_bots'] = 'no';

Check the user agent and prevent caching items when a bot is detected.

$config['speedy_break_async'] = 'no';

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

$config['speedy_diagnostics_enabled'] = 'no';

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

$config['speedy_driver'] = 'dummy';

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.

$config['speedy_driver_fragment'] = 'yes';

This lets you cache some pages with the static driver and cache other pages using fragments. A duel setup might look like this in your config file.

$config['speedy_driver'] = 'static';
$config['speedy_driver_fragment'] = 'redis';

Set this to no to disable Speedy completely.

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.

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

Set this to yes to prevent ACT requests from being cached. This is only necessary if an {exp:speedy:static} or {exp:speedy:fragment} tag is added to something that gets parsed as a template in an Action request, which is very uncommon. (Default: "no")

Set this to yes to prevent POST requests from being cached.

This is a new config option added in 1.15. It is designed to help assist when configuring Speedy for MSM sites. For example if a key, such as static_path is defined in the array for a site it will override the $config['speedy_static_path'] config value. Only static_path and frontedit_check_url values are supported as site specific overrides. If you define different values for static_path Speedy will place static cache files in the respective directory defined for the site. It will also duplicate the utilities folder normally found in the static directory. In most cases the only override necessary, if you're using ExpressionEngine's Frontedit feature, is setting the frontedit_check_url URL. Using separate folders for static_path is not required, but simply provided if you want cleaner separation of the cache files and utilities folders for each site.

Prevent caching items when the visitor is logged in.

Prevent caching items when the visitor is logged out.

Add an array of $_GET keys that are valid when caching a static page.

Set this to no to disable cURL drivers when refreshing the cache.

Attempt to refresh the cache asynchronously when possible.

Set this to no to disable exec drivers when refreshing the cache. Exec drivers attempt to use PHP's exec() function to perform refreshes.

The number of seconds to sleep between refreshing cache items.

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

The path to the static file cache directory. [document root] is determined by either $_SERVER['DOCUMENT_ROOT'] or ExpressionEngine's FCPATH .

Set this to yes to enable the static file cache.

Set this to yes to save static cache files as .html files. By default Speedy saves the static cache files as .php files, with the contents of the page stored in the file, along with logic to handle redirects, CSRF tags, and custom headers. In some rare cases the encoding/escaping used to save the page contents in the .php file can cause parsing issues. Enabling this option will instead save the actual contents of the page as a basic .html file along side the .php file, which will still be used to handle redirects, custom headers etc. If the .html file is present, the .php file will use it's content instead of what is in the .php file.

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.

This will disable the action that will clear cached items based on category cache breaking rules when a category is saved or deleted.

If the Queue module is installed, tell Speedy to queue all cache breaking and url refreshing actions.

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.

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

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

Ignoring URLs

You can ignore URLs by not adding the {exp:speedy:static} tag to a template, but in the event you need it in the template for one use case, but want to exlude caching that page in a different use case where the same template is applied, you can use the following setting.

You can still optionally wrap the {exp:speedy:static} tag in a conditional.

Environment Config

Added in v1.14.0

If you are using the .env.php file you can configure Redis and Memcahced using environment variables.

In the control panel, prefix the variable name with a $ to indicate to Speedy that it should load the value from the .env.php file if present.

This option is only available for connection settings. You can not define Ignored URLs through the environment config.

Last updated

Was this helpful?