Control Panel
Last updated
Last updated
To access Speedy from the control panel, navigate to Developer > Add-On Manager > Speedy.
From here you can:
See which drivers are available on your server.
Clear the cache for each driver individually, or all drivers for this site only, or for all sites.
Configure cache breaking settings for each channel.
Speedy offers config.php file overrides for each driver, and will inform you when overrides are in place.
If a driver is not supported, or not properly configured, you will be informed what the issue is by clicking it's status. A fully supported and configured driver will be displayed as Available in green.
If you are using the Static driver, or Redis with static enabled, you may see an additional prompt to complete the configuration. Speedy will create a few files within your /static folder, and if using Redis with static enabled, will create an index_redis_default_site.php
file in the root of your site. Once the proper htaccess rules are applied, this file will be loaded for every front-end page request.
If you have changed your Speedy settings, or the /static folder does not have the necessary files to handle static caching, you may see the following error:
By clicking on the magnifying glass, you can navigate the contents of that driver. Each page lists the items and paths to items cached and gives you the option to delete or view and item and to clear all items at a path, as well as usage statistics.
Note that some cache drivers, such as Static file based caching, will display N/A for Hits, Misses, and Uptime. Static caching is based on flat files, because of that there is no mechanism to save hits or misses to (recording this in a database would defeat the purpose of static caching).
By clicking into the Cache Breaking menu, you can configure the settings for each channel individually and for all channels.
From the cache breaking settings page, you can configure which items are removed from the cache based on the item key or tags when an entry from that channel is created, updated or deleted.
You can configure the tags to break, specific items to clear and whether these items should be refreshed, and the delay between refreshing each item.
The following is a full list of variables youc an use in these field values.
For example, if you are using the Structure module with static caching, and you want to clear a page's cache when the entry is saved, you'd enter static/{page_uri}
as a Clear Item value.
Available starting in Speedy v1.11.0
Clear Items and Clear Tags both support regular expression pattern matching. For example if you have a paginated set of pages that are cached, and when any entry in one of those pages is updated you may need to clear the cache for all pagination pages (e.g. /blog/P2, /blog/P3 etc). Since pagination grows over time managing the clearing rules for this would become burdensome. Instead you can create one Clear Items entry with the following value:
^static/blog/P[0-9]+
^static/blog/P(\d+)
would also work, but not if you're using the Database cache driver. MySQL's regular expression operation has a slightly different syntax.
Note that both examples are starting with a ^
, which indicates the start of a string to match. The ^
is required as part of Speedy's support for regular expression matching. It indicates to Speedy that it needs to alter the behavior used from matching exact strings, which is the fastest method, to using a regular expression, which can be a little slower.
If you are using the Redis driver with static or fragment caching, be very strict with your regular expression's. The smaller the matching pattern the better because Redis does not have a performant method to find cached items with regular expressions. Using the example above, static/blog/^P[0-9]+
would actually be much more performant in Redis than matching the whole string. Speedy splits up the regular expression beginning at the ^
to optimize the Redis query to the smallest possible data set before performing the pattern matching. It will only look in the static/blog/
subset of keys to match, ignoring all other keys, instead of trying to match static/blog/P[0-9]+
against all keys in Redis.
You can also use similar regular expressions to match against tags. If you tag a bunch products with their product ID, e.g. product-123
, product-456
, or product-789
, you can enter one rule to clear all items matching that tag: ^product-[0-9]+
A few things to note:
Pattern matching is only supported in the Database, Redis, File, and Static cache drivers.
As stated, use pattern matching very carefully if using Redis.
Support for pattern matching is only available if you find a clear and obvious bug with the pattern matching feature. Support is not provided to help determine what pattern should be used to clear items. There are plenty of tools available to help write regular expressions.