Skip to content

Exclude patterns 2.0+ ​

📝 Name: exclude · 🖥️ Option: -e, --exclude · 📚 Multiple values allowed

Patterns of URLs to be excluded from cache warmup.

Regular expression ​

Provide a regular expression with delimiter #.

bash
./cache-warmup.phar -e "#(no_cache|no_warming)=1#"
./cache-warmup.phar --exclude "#(no_cache|no_warming)=1#"
json
{
    "exclude": [
        "#(no_cache|no_warming)=1#"
    ]
}
php
use EliasHaeussler\CacheWarmup;

return static function (CacheWarmup\Config\CacheWarmupConfig $config) {
    $config->addExcludePattern(
        CacheWarmup\Config\Option\ExcludePattern::createFromRegularExpression('#(no_cache|no_warming)=1#'),
    );

    return $config;
};
yaml
exclude:
  - '#(no_cache|no_warming)=1#'
bash
CACHE_WARMUP_EXCLUDE="#(no_cache|no_warming)=1#"

fnmatch pattern ​

Provide a pattern that is supported by fnmatch.

bash
./cache-warmup.phar -e "*no_cache=1*"
./cache-warmup.phar --exclude "*no_cache=1*"
json
{
    "exclude": [
        "*no_cache=1*"
    ]
}
php
use EliasHaeussler\CacheWarmup;

return static function (CacheWarmup\Config\CacheWarmupConfig $config) {
    $config->addExcludePattern(
        CacheWarmup\Config\Option\ExcludePattern::createFromPattern('*no_cache=1*'),
    );

    return $config;
};
yaml
exclude:
  - '*no_cache=1*'
bash
CACHE_WARMUP_EXCLUDE="*no_cache=1*"

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