Crawling strategy 2.0+ ​
📝 Name: strategy · 🖥️ Option: -s, --strategy
Optional crawling strategy to prepare URLs before crawling them.
Sort by changefreq ​
Sorts collected URLs by their changefreq value in an XML sitemap before crawling them.
bash
./cache-warmup.phar -s sort-by-changefreq
./cache-warmup.phar --strategy sort-by-changefreqjson
{
"strategy": "sort-by-changefreq"
}php
use EliasHaeussler\CacheWarmup;
return static function (CacheWarmup\Config\CacheWarmupConfig $config) {
$config->setStrategy(
new CacheWarmup\Crawler\Strategy\SortByChangeFrequencyStrategy(),
);
return $config;
};yaml
strategy: sort-by-changefreqbash
CACHE_WARMUP_STRATEGY=sort-by-changefreqSort by lastmod ​
Sorts collected URLs by their lastmod value in an XML sitemap before crawling them.
bash
./cache-warmup.phar -s sort-by-lastmod
./cache-warmup.phar --strategy sort-by-lastmodjson
{
"strategy": "sort-by-lastmod"
}php
use EliasHaeussler\CacheWarmup;
return static function (CacheWarmup\Config\CacheWarmupConfig $config) {
$config->setStrategy(
new CacheWarmup\Crawler\Strategy\SortByLastModificationDateStrategy(),
);
return $config;
};yaml
strategy: sort-by-lastmodbash
CACHE_WARMUP_STRATEGY=sort-by-lastmodSort by priority ​
Sorts collected URLs by their priority value in an XML sitemap before crawling them.
bash
./cache-warmup.phar -s sort-by-priority
./cache-warmup.phar --strategy sort-by-priorityjson
{
"strategy": "sort-by-priority"
}php
use EliasHaeussler\CacheWarmup;
return static function (CacheWarmup\Config\CacheWarmupConfig $config) {
$config->setStrategy(
new CacheWarmup\Crawler\Strategy\SortByPriorityStrategy(),
);
return $config;
};yaml
strategy: sort-by-prioritybash
CACHE_WARMUP_STRATEGY=sort-by-priority