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

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

openclassrooms/cache-bundle
===========================

Symfony2 Bundle for OpenClassrooms Cache

v2.2.1(1y ago)0395.1k1[1 issues](https://github.com/OpenClassrooms/CacheBundle/issues)MITPHPPHP &gt;=8.2

Since Feb 5Pushed 1y ago21 watchersCompare

[ Source](https://github.com/OpenClassrooms/CacheBundle)[ Packagist](https://packagist.org/packages/openclassrooms/cache-bundle)[ RSS](/packages/openclassrooms-cache-bundle/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (3)Dependencies (5)Versions (11)Used By (0)

[![Build Status](https://camo.githubusercontent.com/6d5ee4521431234ed0d612f0fbe0ac59baa8bbe1afad65a6248fa525d2b05013/68747470733a2f2f7472617669732d63692e6f72672f4f70656e436c617373726f6f6d732f436163686542756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/OpenClassrooms/CacheBundle)[![SensioLabsInsight](https://camo.githubusercontent.com/e202382326c8cd2fb0aab0aab4d02f365f63318e9f9a543d435e7244d4b178a6/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f62303465323362662d386533362d343730342d383031652d6262323961373731396564332f6d696e692e706e67)](https://insight.sensiolabs.com/projects/b04e23bf-8e36-4704-801e-bb29a7719ed3)[![Coverage Status](https://camo.githubusercontent.com/956634fbed20d272a40dd8dac4b38212eb79f773c6bff0bfe42f123ebdd8b6cc/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f4f70656e436c617373726f6f6d732f436163686542756e646c652f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/OpenClassrooms/CacheBundle?branch=master)

CacheBundle adds features to Doctrine Cache implementation

- Default lifetime
- Fetch with a namespace
- Save with a namespace
- Cache invalidation through namespace strategy
- CacheProvider Builder

See [OpenClassrooms/Cache](https://github.com/OpenClassrooms/Cache) for more details.

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

[](#installation)

This bundle can be installed using composer:

`composer require openclassrooms/cache-bundle`or by adding the package to the composer.json file directly.

```
{
    "require": {
        "openclassrooms/cache-bundle": "*"
    }
}
```

After the package has been installed, add the bundle to the AppKernel.php file:

```
// in AppKernel::registerBundles()
$bundles = array(
    // ...
    new OpenClassrooms\Bundle\CacheBundle\OpenClassroomsCacheBundle(),
    // ...
);
```

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

[](#configuration)

```
open_classrooms_cache:
    default_lifetime: 10    (optional, default = 0)
# Providers
    # array
    provider: array
    # redis
    provider:
        redis:
            host: localhost
            port: 6379      (optional, default = 6379)
            timeout: 0.0    (optional, default = 0.0)
```

Usage
-----

[](#usage)

The configured cache is available as `openclassrooms.cache.cache` service:

```
$cache = $container->get('openclassrooms.cache.cache');

$cache->fetch($id);
$cache->fetchWithNamespace($id, $namespaceId);
$cache->save($id, $data);
$cache->saveWithNamespace($id, $data, $namespaceId);
$cache->invalidate($namespaceId);
```

The configured cache provider is available as `openclassrooms.cache.cache_provider` service:

```
$cacheProvider = $container->get('openclassrooms.cache.cache_provider');
```

The cache provider builder is available as `openclassrooms.cache.cache_provider` service:

```
$builder = $container->get('openclassrooms.cache.cache_provider_builder');

// Redis
$cacheProvider = $builder
    ->create(CacheProviderType::REDIS)
    ->withHost('127.0.0.1')
    ->withPort(6379) // Default 6379
    ->withTimeout(0.0) // Default 0.0
    ->build();
```

See [OpenClassrooms/Cache](https://github.com/OpenClassrooms/Cache) for more details.

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 55.6% 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 ~395 days

Recently: every ~466 days

Total

7

Last Release

648d ago

Major Versions

v1.0.0 → v2.0.02019-06-26

PHP version history (3 changes)1.0.x-devPHP &gt;=5.5

v2.0.0PHP &gt;=7.1

v2.2.0PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/d82b0e2dcc1728eacb2b83c259311b5ea7c3253bd08f1341d45df79bdd9ba77a?d=identicon)[openclassrooms-admin](/maintainers/openclassrooms-admin)

![](https://www.gravatar.com/avatar/a4eaa1e2bd9272e248e28561739200cbcfd705cc4d3fec9d3e4d595f3dd12165?d=identicon)[romainkuzniak](/maintainers/romainkuzniak)

---

Top Contributors

[![kletord](https://avatars.githubusercontent.com/u/392556?v=4)](https://github.com/kletord "kletord (15 commits)")[![samokiss](https://avatars.githubusercontent.com/u/8625072?v=4)](https://github.com/samokiss "samokiss (6 commits)")[![alex-ception](https://avatars.githubusercontent.com/u/636722?v=4)](https://github.com/alex-ception "alex-ception (2 commits)")[![DotnDev](https://avatars.githubusercontent.com/u/57391746?v=4)](https://github.com/DotnDev "DotnDev (2 commits)")[![prollandoc](https://avatars.githubusercontent.com/u/70900670?v=4)](https://github.com/prollandoc "prollandoc (2 commits)")

---

Tags

cacheopenclassroomsphpsymfonysymfony-bundle

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[symfony/security-bundle

Provides a tight integration of the Security component into the Symfony full-stack framework

2.5k172.9M1.8k](/packages/symfony-security-bundle)[sonata-project/entity-audit-bundle

Audit for Doctrine Entities

644989.8k1](/packages/sonata-project-entity-audit-bundle)

PHPackages © 2026

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