PHPackages                             zenstruck/cache-bundle - 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. zenstruck/cache-bundle

AbandonedArchivedSymfony-bundle[Caching](/categories/caching)

zenstruck/cache-bundle
======================

Provides a httpcache warmup command for Symfony2

v3.0.0(10y ago)3911.0k2MITPHP

Since Feb 28Pushed 10y ago1 watchersCompare

[ Source](https://github.com/kbond/ZenstruckCacheBundle)[ Packagist](https://packagist.org/packages/zenstruck/cache-bundle)[ Docs](http://zenstruck.com/project/ZenstruckCacheBundle)[ RSS](/packages/zenstruck-cache-bundle/feed)WikiDiscussions master Synced today

READMEChangelog (6)Dependencies (11)Versions (13)Used By (0)

ZenstruckCacheBundle
====================

[](#zenstruckcachebundle)

[![Build Status](https://camo.githubusercontent.com/b9800b931f67dbefe4e2b71c1b12066c492ae9e4d5bc21d63d3821f9b89d6a35/687474703a2f2f696d672e736869656c64732e696f2f7472617669732f6b626f6e642f5a656e73747275636b436163686542756e646c652e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/kbond/ZenstruckCacheBundle)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/835e9b4885bb8de3e0cdf7f0104fd24964ac3c2a2ced8d4f4269e4e843e41710/687474703a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6b626f6e642f5a656e73747275636b436163686542756e646c652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/kbond/ZenstruckCacheBundle/)[![Code Coverage](https://camo.githubusercontent.com/dc96477867f1d54f8f6380152ba69f8b7b1f883faff9cc5be6f0cdccf2abc2a4/687474703a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6b626f6e642f5a656e73747275636b436163686542756e646c652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/kbond/ZenstruckCacheBundle/)[![StyleCI](https://camo.githubusercontent.com/6e1c60e7889eff68e3b267feb67cea11cd6af58909930320d35abd546aae3619/68747470733a2f2f7374796c6563692e696f2f7265706f732f373931343838322f736869656c64)](https://styleci.io/repos/7914882)[![Latest Stable Version](https://camo.githubusercontent.com/6c2b196692aa2dbadefc6e8f0538b2ac4646542f44fecd6c7280067911391b87/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a656e73747275636b2f63616368652d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/zenstruck/cache-bundle)[![License](https://camo.githubusercontent.com/bfc2917ca90081b706e23e09547e7ccca015875a87103d29b24c15714425cacc/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7a656e73747275636b2f63616368652d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/zenstruck/cache-bundle)

Provides a httpcache warmup command for Symfony2. The command simply executes a `GET` request on a list of urls. One or more url providers must be registered. This bundle requires an implementation of [php-http/httplug](https://packagist.org/packages/php-http/httplug) and [php-http/message-factory](https://packagist.org/packages/php-http/message-factory).

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

[](#installation)

1. Add to your `composer.json`:

    ```
    $ composer require zenstruck/cache-bundle

    ```
2. Register this bundle with Symfony2:

    ```
    // app/AppKernel.php

    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Zenstruck\CacheBundle\ZenstruckCacheBundle(),
        );
        // ...
    }
    ```

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

[](#configuration)

An `http_client` (class or service implementing `Http\Client\HttpClient`) and `message_factory`(class or service implementing `Http\Message\MessageFactory`) must be configured.

```
zenstruck_cache:
    http_client:    Acme\MyHttpClient    # or a service (acme.my_http_client)
    message_factory: Acme\MyMessageFactory # or a service (acme.my_message_factory)
```

HttpCache Warmup Command
------------------------

[](#httpcache-warmup-command)

Usage:

```
app/console zenstruck:http-cache:warmup

```

Sitemap Provider
----------------

[](#sitemap-provider)

This bundle comes with a URL provider that looks at a list of sitemaps to retrieve a list of urls. If a url is given without the sitemap or sitemap index, the provider first looks for a `{url}/sitemap_index.xml` to find a set of sitemap files. If no index is found, it defaults to using `{url}/sitemap.xml`.

- See  for information on how to create a sitemap.
- See [DpnXmlSitemapBundle](https://github.com/bjo3rnf/DpnXmlSitemapBundle) for creating a sitemap with Symfony2.

To enable the sitemap provider, configure it in your `config.yml`:

```
zenstruck_cache:
    sitemap_provider:
        sitemaps:
            - http://example.com/sitemap.xml # detects if sitemap or sitemap index and act accordingly
            - http://example.com/en/sitemap.xml # same as above
            - http://www.example.com # trys http://example.com/sitemap_index.xml and http://example.com/sitemap.xml
```

Add a Custom URL Provider
-------------------------

[](#add-a-custom-url-provider)

1. Create a class that implements `Zenstruck\CacheBundle\Url\UrlProvider`:

    ```
    use Zenstruck\CacheBundle\Url\UrlProvider;

    namespace Acme;

    class MyUrlProvider implements UrlProvider
    {
        public function getUrls()
        {
            $urls = array();

            // fetch from a datasource

            return $urls;
        }

        public function count()
        {
            return count($this->getUrls());
        }
    }
    ```
2. Register the class as a service tagged with `zenstruck_cache.url_provider`:

    ```
    my_url_provider:
        class: Acme\MyUrlProvider
        tags:
            - { name: zenstruck_cache.url_provider }
    ```

Full Default Config
-------------------

[](#full-default-config)

```
zenstruck_cache:
    # Either a class or a service that implements Http\Client\HttpClient.
    http_client:              ~ # Required

    # Either a class or a service that implements Http\Message\MessageFactory.
    message_factory:          ~ # Required

    sitemap_provider:
        enabled:              false
        sitemaps:             []
```

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 87.5% 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 ~97 days

Recently: every ~111 days

Total

12

Last Release

3804d ago

Major Versions

v1.2.2 → v2.0.0-alpha12014-11-12

2.x-dev → v3.0.02016-02-01

### Community

Maintainers

![](https://www.gravatar.com/avatar/707369cc916e0ea1aacbf077dcba464f611cef879f024d8944311a54a15224b3?d=identicon)[kbond](/maintainers/kbond)

---

Top Contributors

[![kbond](https://avatars.githubusercontent.com/u/127811?v=4)](https://github.com/kbond "kbond (56 commits)")[![toooni](https://avatars.githubusercontent.com/u/241080?v=4)](https://github.com/toooni "toooni (8 commits)")

---

Tags

cachecachinghttpcache

### Embed Badge

![Health badge](/badges/zenstruck-cache-bundle/health.svg)

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M736](/packages/sylius-sylius)[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[ecotone/symfony-bundle

Ecotone for Symfony — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Symfony Messenger, via PHP attributes.

11249.0k1](/packages/ecotone-symfony-bundle)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)[symfony/ux-toolkit

A tool to easily create a design system in your Symfony app with customizable, well-crafted Twig components

16126.1k1](/packages/symfony-ux-toolkit)

PHPackages © 2026

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