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

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

becklyn/cache
=============

A cache bundle providing a simple (and fast) cache

1.1.0(4y ago)112.0k↓72.7%1BSD-3-ClausePHPPHP &gt;=7.4CI failing

Since Feb 3Pushed 4y ago3 watchersCompare

[ Source](https://github.com/Becklyn/cache-bundle)[ Packagist](https://packagist.org/packages/becklyn/cache)[ Docs](https://github.com/Becklyn/cache-bundle)[ RSS](/packages/becklyn-cache/feed)WikiDiscussions 1.x Synced 2d ago

READMEChangelog (3)Dependencies (8)Versions (5)Used By (1)

Becklyn Cache Bundle
====================

[](#becklyn-cache-bundle)

Provides a simple cache, that should be easy to use and high performance. Warning: for highly concurrent usage you should either prepare the cache in advance or use symfony's own cache, as it has proper cache stampede protection.

Usage
-----

[](#usage)

Fetch the simple cache factory and get the cache item:

```
use Becklyn\Cache\Cache\SimpleCacheFactory;

class MyService
{
    private SimpleCacheItemInterface $cache;

    /**
     */
    public function __construct (SimpleCacheFactory $cacheFactory)
    {
        $this->cache = $cacheFactory->getItem(
            "my.cache.key",
            fn () => $this->loadItems()
        );
    }

    /**
     * Returns the cached or fresh items, depending on several conditions.
     */
    public function getItems () : array
    {
        return $this->cache->get();
    }

    /**
     * Loads the items from the database
     */
    public function loadItems () : array
    {
        // ...
    }
}
```

Caching Based on Symfony Config
-------------------------------

[](#caching-based-on-symfony-config)

You can either pass the cache key and generator to the `getItem()` method (like in the example above), or you can additionally pass in resources that should be tracked and can be used for cache invalidation.

If you pass resources, this will be a two-level cache:

1. first level will be the plain symfony/cache, which is really fast but has no proper way of cache invalidation.
2. second level will be the `ConfigCache` which will automatically be invalidated if some of the tracked resources change.

```
$cacheFactory->getItem(
    "my.cache.key",
    fn () => $this->loadItems(),
    // eg. if your cache status depends on routing resources
    $this->router->getRouteCollection()->getResources()
 );
```

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

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 ~248 days

Total

4

Last Release

1598d ago

PHP version history (2 changes)1.0.0PHP ^7.2

1.1.0PHP &gt;=7.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1044355?v=4)[Becklyn Studios](/maintainers/becklyn)[@Becklyn](https://github.com/Becklyn)

### Embed Badge

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

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

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[symfony/framework-bundle

Provides a tight integration between Symfony components and the Symfony full-stack framework

3.6k251.7M11.6k](/packages/symfony-framework-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[open-dxp/opendxp

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

9421.6k61](/packages/open-dxp-opendxp)[chameleon-system/chameleon-base

The Chameleon System core.

1028.6k5](/packages/chameleon-system-chameleon-base)

PHPackages © 2026

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