PHPackages                             fabrizio-cafolla/cache-system - 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. [Framework](/categories/framework)
4. /
5. fabrizio-cafolla/cache-system

Abandoned → [kosmosx/cache](/?search=kosmosx%2Fcache)ArchivedLumen-package[Framework](/categories/framework)

fabrizio-cafolla/cache-system
=============================

Cache service for Laravel / Lumen Framework.

1.0.1(6y ago)181712MITPHPPHP &gt;=7.1.3

Since Aug 23Pushed 6y ago1 watchersCompare

[ Source](https://github.com/KosmosX/cache)[ Packagist](https://packagist.org/packages/fabrizio-cafolla/cache-system)[ RSS](/packages/fabrizio-cafolla-cache-system/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (4)Versions (4)Used By (0)

Cache System
============

[](#cache-system)

[![](https://camo.githubusercontent.com/97f85f046265623c4b26076add9bcc55f9608152c20e78f07076369977c77d05/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d677265656e2e737667)](https://camo.githubusercontent.com/97f85f046265623c4b26076add9bcc55f9608152c20e78f07076369977c77d05/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d677265656e2e737667) [![](https://camo.githubusercontent.com/38bbfd9727a6f61bd6013f369beacca2f30c38431cc66d8cb09371e9071b67ee/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d2533453d352e372d626c75652e737667)](https://camo.githubusercontent.com/38bbfd9727a6f61bd6013f369beacca2f30c38431cc66d8cb09371e9071b67ee/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d2533453d352e372d626c75652e737667) [![](https://camo.githubusercontent.com/fb8a9e523786e1002dc45c0483be7cb6285bd7bef0b1faf94ef38b59ab5099dc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c756d656e2d2533453d352e372d626c75652e737667)](https://camo.githubusercontent.com/fb8a9e523786e1002dc45c0483be7cb6285bd7bef0b1faf94ef38b59ab5099dc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c756d656e2d2533453d352e372d626c75652e737667)

##### Why use it?

[](#why-use-it)

> Manage your cache easily. This package is useful for better managing the File or Redis cache. Implements the functions for creating and returning caches using json-encoded serialization to make the cache transportable and usable by other external microservices.

##### Install &amp; Configuration

[](#install--configuration)

```
composer require kosmosx/cache

```

You must enter the following provider in the bootstrap/app.php file: Uncomment the function

```
$app->withFacades();

```

Load configuration in boostrap file

```
$this->configure('cache');
$this->configure('database');

```

Or publish config in your Service Provider

```
$this->publishes([
    'Kosmosx/Cache/config/cache.php' => config_path('cache.php')
], 'config');

$this->publishes([
    'Kosmosx/Cache/config/database.php' => config_path('database.php')
], 'config');

```

Register service provider

```
$app->register(Kosmosx\Cache\CacheServiceProvider::class);

```

#### Documentation

[](#documentation)

Once you have cofigured using it:

```
$factory = app('factory.cache');            //return CacheFactory
$builderFile = $factory->file();            //return FileBuilder
$builderRedis = $factory->redis();          //return RedisBuilder

$file = app('service.cache.file');          //FileCommand
$redis = app('service.cache.redis');        //RedisCommand

```

**SET**

```
//If you use builder obj
$builderRedis->default()->set($key, $value, $ttl);          //build FileCommand with DefaultSerializer and set cache
$builderRedis->response()->set($response, $value, $ttl);
$builderRedis->collect()->set($collect, $value, $ttl);

//With services
$file->set($key, $value, $ttl);
$redis->set($key, $value, $ttl);

```

**SET MANY**

```
//array example: ["key" => $value, "key2" => $value2 ...]
//$ttl for all values

$builderFile->default()->setMany(array $values, $ttl);

$file->setMany(array $values, $ttl);
$redis->setMany(array $values, $ttl);

```

**GET**

```
$file->get($key, $serializer);
$redis->get($key, $serializer);

```

**GET MANY**

```
//array example: ["key", "key2", "keyN" ...]

$file->getMany(array $keys);
$redis->getMany(array $keys);

```

**SERIALIZER**

All data stored in cache (redis / file) are serialized with the json coding, so as to make them transportable by other languages. it is possible to use typed serializers, so that when it is recovered it is possible to reconstruct the initial object.

```
//Serializer
ResponseSerializer()  //If you want cache Response object
CollectSerializer()   //If you want cache Collect object
DefaultSerializer()   //default cache

...->setSerializer(new ResponseSerializer());

```

**Own Serializer**

If you want to create your own serializer, just create a class that extends SerializerAbstract

```
use Kosmosx\Cache\Serializer\Abstracts\Serializer;
use Kosmosx\Cache\Serializer\Interfaces\SerializerInterface;

class {name} extends Serializer implements SerializerInterface

```

**Other function**

```
 //Use class cache manager
 ...->manager()	//return istance of Illuminate/Redis or CacheManager

 ...->forget(string $keys)
 ...->forgetMany(array $keys)

 ...->setAutodetect($bool)
 ...->getAutodetect()

 ...->clear()

```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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 ~1 days

Total

2

Last Release

2454d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/86b56131c92d8421d2a54614993c2bf00e91b1265de5b88948fd90d00b986d7e?d=identicon)[Fabrizio Cafolla](/maintainers/Fabrizio%20Cafolla)

---

Top Contributors

[![FabrizioCafolla](https://avatars.githubusercontent.com/u/13237032?v=4)](https://github.com/FabrizioCafolla "FabrizioCafolla (5 commits)")[![LasseRafn](https://avatars.githubusercontent.com/u/2689341?v=4)](https://github.com/LasseRafn "LasseRafn (1 commits)")

---

Tags

cachecache-storagelaravel-redis-cachelaravel5lumenphp-cacheredis-cacheserializerframeworklaravellumenrediscache

### Embed Badge

![Health badge](/badges/fabrizio-cafolla-cache-system/health.svg)

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

###  Alternatives

[lushdigital/microservice-core

A set of core functionality and convenience classes for a Lumen microservice.

105.5k](/packages/lushdigital-microservice-core)

PHPackages © 2026

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