PHPackages                             rafafortes/cache-warmer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. rafafortes/cache-warmer

ActiveLibrary[Caching](/categories/caching)

rafafortes/cache-warmer
=======================

A simple Magento 2 cache warmer tool.

1.0.7(1y ago)12.9k↓68.1%2MITPHPPHP &gt;=8.0

Since Jan 26Pushed 1y ago1 watchersCompare

[ Source](https://github.com/rafafortes/cache-warmer)[ Packagist](https://packagist.org/packages/rafafortes/cache-warmer)[ RSS](/packages/rafafortes-cache-warmer/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (8)DependenciesVersions (9)Used By (0)

Cache Warmer for Magento 2
==========================

[](#cache-warmer-for-magento-2)

Cache Warmer is a PHP tool designed to crawl and cache all internal URLs of a Magento 2 store to improve page load speeds by preloading content into Varnish cache.

Features
--------

[](#features)

- Crawls all internal URLs starting from the homepage or URLs specified in the `urls` file.
- Extracts URLs from the store's `sitemap.xml`.
- Handles URL normalization and parameter variations.
- Skips unwanted file types (e.g., images, PDFs).
- Skips URLs based on a blacklist file with customizable patterns.
- Displays real-time processing details such as response codes and load times.
- Shows time in milliseconds for each URL loaded.
- Prevents duplicate URL processing.
- **Multi-threading:** Supports parallel processing of URLs to speed up the crawling process.
- **Debug mode:** Outputs all links found on each accessed page.

Installation
------------

[](#installation)

### Using Composer

[](#using-composer)

To install the package via Composer, run the following command:

```
composer require rafafortes/cache-warmer
```

Alternatively, add the package manually to your `composer.json`:

```
{
    "require": {
        "rafafortes/cache-warmer": "^1.0"
    }
}
```

Then, run:

```
composer install
```

Usage
-----

[](#usage)

Once installed, you can run the script from the command line:

```
php vendor/rafafortes/cache-warmer/src/UrlFetcher.php   [--debug] []
```

### File-based URL Initialization

[](#file-based-url-initialization)

You can specify additional URLs to be crawled by creating a `urls` file in the root directory. This file should list one URL per line. The first URL in the file can also serve as the `baseUrl` if needed.

**Example `urls` file:**

```
https://example.com
https://example.com/page1
https://example.com/page2

```

### Multi-threading

[](#multi-threading)

You can specify the number of threads to process URLs in parallel by adding the number as the last parameter.

**Example with 5 threads:**

```
php vendor/rafafortes/cache-warmer/src/UrlFetcher.php https://example.com https://example.com/sitemap.xml --debug 5
```

If the number of threads is not specified, the default is 1 thread.

### Debug Mode

[](#debug-mode)

You can enable debug mode by adding the `--debug` parameter to the command. This mode outputs all URLs found on each accessed page.

**Example:**

```
php vendor/rafafortes/cache-warmer/src/UrlFetcher.php https://example.com https://example.com/sitemap.xml --debug
```

### Blacklist Configuration

[](#blacklist-configuration)

You can exclude specific URLs by adding patterns to a file named `blacklist` located in the same directory as the script. Each line of the file should contain a pattern to be ignored.

**Example `blacklist` file:**

```
productalert/add
checkout/cart
customer/account

```

The script will automatically load and apply the blacklist, skipping any URLs that contain the specified patterns.

### Output

[](#output)

The script will output information about each processed URL, including:

- Loading time (in milliseconds)
- HTTP response code
- Total number of URLs processed
- Execution time
- Number of skipped duplicate URLs
- URLs skipped due to blacklist rules (if any)

Requirements
------------

[](#requirements)

- PHP 8.0 or higher
- Composer

Configuration
-------------

[](#configuration)

Ensure your project follows the correct directory structure for autoloading:

```
/project-root
├── composer.json
├── src
│   └── UrlFetcher.php
├── blacklist
├── urls
└── README.md

```

Contributing
------------

[](#contributing)

Contributions are welcome! Feel free to submit a pull request or open an issue to suggest improvements.

License
-------

[](#license)

This project is licensed under the MIT License.

Author
------

[](#author)

Developed by [Rafa Fortes](https://github.com/rafafortes).

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

8

Last Release

567d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20464782?v=4)[Rafael dos Passos Fortes](/maintainers/rafafortes)[@rafafortes](https://github.com/rafafortes)

---

Top Contributors

[![rafafortes](https://avatars.githubusercontent.com/u/20464782?v=4)](https://github.com/rafafortes "rafafortes (8 commits)")

### Embed Badge

![Health badge](/badges/rafafortes-cache-warmer/health.svg)

```
[![Health](https://phpackages.com/badges/rafafortes-cache-warmer/health.svg)](https://phpackages.com/packages/rafafortes-cache-warmer)
```

###  Alternatives

[iazaran/smart-cache

Smart Cache is a caching optimization package designed to enhance the way your Laravel application handles data caching. It intelligently manages large data sets by compressing, chunking, or applying other optimization strategies to keep your application performant and efficient.

21114.2k](/packages/iazaran-smart-cache)[phpfastcache/phpssdb

PHP SSDB Driver for phpFastCache

14736.9k1](/packages/phpfastcache-phpssdb)[rapidwebltd/rw-file-cache

RW File Cache is a PHP File-based Caching Library. Its syntax is designed to closely resemble the PHP memcache extension.

15196.8k7](/packages/rapidwebltd-rw-file-cache)[yuzuru-s/redis-recommend

Wrapping Redis's sorted set APIs for specializing recommending operations.

392.9k](/packages/yuzuru-s-redis-recommend)[ichhabrecht/intcache

Turn uncachable page objects into cacheable links

193.9k](/packages/ichhabrecht-intcache)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
