Skip to content

Option Reference

The CacheWarmer class accepts a limited set of configuration options. They can be provided as constructor parameters.

limit

🐝 Default: 0

Same as the limit configuration option.

php
use EliasHaeussler\CacheWarmup;

$cacheWarmer = new CacheWarmup\CacheWarmer(
    limit: 10,
);
$cacheWarmer->run();

client

🐝 Default: new GuzzleHttp\Client()

A preconfigured Guzzle client to use when parsing XML sitemaps.

php
use EliasHaeussler\CacheWarmup;

$cacheWarmer = new CacheWarmup\CacheWarmer(
    client: new \GuzzleHttp\Client([
        'handler' => $handler,
    ]),
);
$cacheWarmer->run();

crawler

🐝 Default: new EliasHaeussler\CacheWarmup\Crawler\ConcurrentCrawler()

Same as the crawler configuration option.

php
use EliasHaeussler\CacheWarmup;

$cacheWarmer = new CacheWarmup\CacheWarmer(
    crawler: new \Vendor\Crawler\MyCustomCrawler(),
);
$cacheWarmer->run();

strategy

🐝 Default: null

Same as the strategy configuration option.

php
use EliasHaeussler\CacheWarmup;

$cacheWarmer = new CacheWarmup\CacheWarmer(
    strategy: new CacheWarmup\Crawler\Strategy\SortByPriorityStrategy(),
);
$cacheWarmer->run();

strict

🐝 Default: true

Opposite of the allowFailures configuration option.

php
use EliasHaeussler\CacheWarmup;

$cacheWarmer = new CacheWarmup\CacheWarmer(
    strict: false,
);
$cacheWarmer->run();

excludePatterns

🐝 Default: []

Same as the exclude configuration option.

php
use EliasHaeussler\CacheWarmup;

$cacheWarmer = new CacheWarmup\CacheWarmer(
    excludePatterns: [
        CacheWarmup\Config\Option\ExcludePattern::create('*foo*'),
    ],
);
$cacheWarmer->run();

Released under the GNU General Public License 3.0 (or later)