A plugin for running a series of cache warming tasks
This plugin requires Craft CMS 3.0.0-beta.23 or later.
To install the plugin, follow these instructions.
-
Open your terminal and go to your Craft project:
cd /path/to/project
-
Then tell Composer to load the plugin:
composer require https://github.com/blue-mantis/cachewarmer/cachewarmer
-
In the Control Panel, go to Settings → Plugins and click the “Install” button for Cache Warmer.
This plugin provides a bunch of cache warming tasks. More details to follow.
Go to Settings, and look for the cachewarmer icon at the bottom. More details on options to follow.
There's currently 2 ways to kick off a cachewarm:
You can call the service method directly to run a cachewarm based on the configuration set in your settings
\bluemantis\cachewarmer\CacheWarmer::$plugin->cacheWarm->run();
Or you can pipe in an array of elements to only warm those
\bluemantis\cachewarmer\CacheWarmer::$plugin->cacheWarm->elements([$element]);
(in the second example the $queue parameter can be safely ignored, this is there to update progress when this is running as a queued job)
- Either add a page for displaying logs or simplify the logger service (or both)
- Add a public endpoint with some sort of basic auth for CI/CD
Brought to you by Bluemantis