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)111.6k↓40.9%1BSD-3-ClausePHPPHP &gt;=7.4

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 1mo 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 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

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

1552d 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.3k16.7M310](/packages/easycorp-easyadmin-bundle)[symfony/framework-bundle

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

3.6k235.4M9.7k](/packages/symfony-framework-bundle)[simplesamlphp/simplesamlphp

A PHP implementation of a SAML 2.0 service provider and identity provider.

1.1k12.4M193](/packages/simplesamlphp-simplesamlphp)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sylius/sylius

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

8.4k5.6M651](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)

PHPackages © 2026

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