Crawling strategies
Before URLs are crawled by a crawler, they can be prepared by a specific strategy. This, for example, allows to prioritize specific URLs or provide additional information to URLs.
- interface CrawlingStrategy
-
- Fully qualified name
-
\Elias
Haeussler\ Cache Warmup\ Crawler\ Strategy\ Crawling Strategy
Interface for crawling strategy to prepare URLs before crawling.
Shipped crawling strategies
The extension ships with the following crawling strategies:
sort-
: Sorts given URLs by their changefreq node value.by- changefreq sort-
: Sorts given URLs by their lastmod node value.by- lastmod sort-
: Sorts given URLs by their priority node value.by- priority
Implement a custom strategy
-
Create a new crawling strategy
The new strategy must implement the
\Elias
interface. Make sure to properly implement theHaeussler\ Cache Warmup\ Crawler\ Strategy\ Crawling Strategy \Elias
method to identify the crawling strategy.Haeussler\ Cache Warmup\ Crawler\ Strategy\ Crawling Strategy:: get Name -
Configure the new crawling strategy
Add the new strategy to the extension configuration. Use the strategy's name as configuration value.
-
Flush system caches
Finally, flush all system caches to ensure the correct crawling strategy is used for further cache warmup requests.
See also
View the sources on GitHub: