---
title: "Crawling strategies"
manual: "Warming"
version: "5.3"
permalink: "https://docs.typo3.org/permalink/eliashaeussler/typo3-warming:crawling-strategies@5.3"
source: "DeveloperCorner/CrawlingStrategies.rst"
rendered: "2026-11-05T08:37:00+00:00"
---

# Crawling strategies {#crawling-strategies}

Before URLs are crawled by a [crawler](https://docs.typo3.org/permalink/eliashaeussler/typo3-warming:crawlers@5.3), 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:* `\EliasHaeussler\CacheWarmup\Crawler\Strategy\CrawlingStrategy`

    Interface for crawling strategy to prepare URLs before crawling.

    -   **prepareUrls($urls)**

        Prepare given URLs for crawling.

        -   *param array $urls:* List of URLs to be prepared for crawling.
        -   *returntype:* `list<\EliasHaeussler\CacheWarmup\Sitemap\Url>`

    -   **static getName()**

        Get name of crawling strategy for use as identifier.

        -   *returntype:* `string`

## Shipped crawling strategies {#shipped-crawling-strategies}

The extension ships with the following crawling strategies:

-   `sort-by-changefreq`: Sorts given URLs by their
    [changefreq](https://www.sitemaps.org/protocol.html#changefreqdef)
    node value.
-   `sort-by-lastmod`: Sorts given URLs by their
    [lastmod](https://www.sitemaps.org/protocol.html#lastmoddef)
    node value.
-   `sort-by-priority`: Sorts given URLs by their
    [priority](https://www.sitemaps.org/protocol.html#prioritydef)
    node value.

## Implement a custom strategy {#implement-a-custom-strategy}

1.  Create a new crawling strategy

    The new strategy must implement the
    [\\EliasHaeussler\\CacheWarmup\\Crawler\\Strategy\\CrawlingStrategy](https://docs.typo3.org/permalink/eliashaeussler/typo3-warming:eliashaeussler-cachewarmup-crawler-strategy-crawlingstrategy@5.3)
    interface. Make sure to properly implement the [\\EliasHaeussler\\CacheWarmup\\Crawler\\Strategy\\CrawlingStrategy::getName](https://docs.typo3.org/permalink/eliashaeussler/typo3-warming:eliashaeussler-cachewarmup-crawler-strategy-crawlingstrategy-getname@5.3)
    method to identify the crawling strategy.
1.  Configure the new crawling strategy

    Add the new strategy to the [extension configuration](https://docs.typo3.org/permalink/eliashaeussler/typo3-warming:extension-configuration@5.3).
    Use the strategy's name as configuration value.
1.  Flush system caches

    Finally, flush all system caches to ensure the correct crawling
    strategy is used for further cache warmup requests.

> [!NOTE]
> **See also**
>
> View the sources on GitHub:
>
> -   [CrawlingStrategy](https://github.com/eliashaeussler/cache-warmup/blob/main/src/Crawler/Strategy/CrawlingStrategy.php)
> -   [SortByChangeFrequencyStrategy](https://github.com/eliashaeussler/cache-warmup/blob/main/src/Crawler/Strategy/SortByChangeFrequencyStrategy.php)
> -   [SortByLastModificationDateStrategy](https://github.com/eliashaeussler/cache-warmup/blob/main/src/Crawler/Strategy/SortByLastModificationDateStrategy.php)
> -   [SortByPriorityStrategy](https://github.com/eliashaeussler/cache-warmup/blob/main/src/Crawler/Strategy/SortByPriorityStrategy.php)
