PHPackages                             mage-stack/module-persistent-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. mage-stack/module-persistent-cache

ActiveMagento2-module[Caching](/categories/caching)

mage-stack/module-persistent-cache
==================================

Magento 2 module for custom cache.

1.0.0(1y ago)40[1 issues](https://github.com/attherateof/PersistentCache/issues)MITPHP

Since Jun 28Pushed 1y ago3 watchersCompare

[ Source](https://github.com/attherateof/PersistentCache)[ Packagist](https://packagist.org/packages/mage-stack/module-persistent-cache)[ Docs](https://github.com/attherateof/PersistentCache)[ RSS](/packages/mage-stack-module-persistent-cache/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Mage2 Module: MageStack Parsistent Cache
========================================

[](#mage2-module-magestack-parsistent-cache)

A robust Magento 2 module that provides a **persistent, isolated cache layer** untouched by Magento's default CLI cache operations (`cache:clean`, `cache:flush`).

Requirements
------------

[](#requirements)

- Magento 2.4.8
- PHP 8.4

Module version
--------------

[](#module-version)

- 1.0.0

Why This Module?
----------------

[](#why-this-module)

In Magento 2, we often store temporary but critical data in cache — such as serialized payloads, or flags for ongoing processes. However, a major concern arises:

- **Running Magento CLI commands like `bin/magento cache:flush` or `cache:clean` can wipe out these important entries**, potentially breaking business logic or corrupting workflows.

### Solution: Persistent, Isolated Cache

[](#solution-persistent-isolated-cache)

This module creates and manages a **completely isolated cache frontend** using its own identifier (`parsistent`). Magento CLI commands **do not affect it** — ensuring your critical data remains safe.

Features
--------

[](#features)

- **Immune to `cache:clean` and `cache:flush`**
- **Supports Valkey, File, and Database backends**
- **Flexible configuration via `env.php`**
- **Simple service interface (`CacheRepositoryInterface`)**
- **Tested with Valkey, File, and DB cache**

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

[](#configuration)

Add a new cache frontend in your `app/etc/env.php` under the `cache` key:

### Valkey

[](#valkey)

```
  'cache' => [
      'frontend' => [
          'parsistent' => [
              'id_prefix' => 'YOUR_PREFIX',
              'backend' => 'Magento\\Framework\\Cache\\Backend\\Redis',
              'backend_options' => [
                  'server' => 'VALKEY_HOST',
                  'database' => 'VALKEY_DB',
                  'port' => 'VALKEY_PORT',
                  'password' => '',
                  'compress_data' => '1',
                  'compression_lib' => '',
                  'use_lua' => '0',
                  'use_lua_on_gc' => '1'
              ]
          ]
      ]
  ],

```

### File

[](#file)

```
  'cache' => [
      'frontend' => [
          'parsistent' => [
              'id_prefix' => 'YOUR_PREFIX',
              'backend' => 'Magento\\Framework\\Cache\\Backend\\File',
              'backend_options' => [
                  'cache_dir' => BP . '/var/cache/parsistent'
              ]
          ]
      ]
  ],

```

### DB

[](#db)

```
  'cache' => [
      'frontend' => [
          'parsistent' => [
              'id_prefix' => 'YOUR_PREFIX',
              'backend' => 'Magento\\Framework\\Cache\\Backend\\Database',
              'backend_options' => [
                  'auto_create_tables' => true
              ]
          ]
      ]
  ],

```

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

[](#installation)

1. **Install the module via Composer**: To install this module, run the following command in your Magento root directory:
    - `composer require mage-stack/module-persistent-cache`
2. **Enable the module:**After installation, enable the module by running:
    - `php bin/magento module:enable MageStack_PersistentCache`
3. **Apply database updates:**Run the setup upgrade command to apply any database changes:
    - `php bin/magento setup:upgrade`
4. **Flush the Magento cache:**Finally, flush the cache:
    - `php bin/magento cache:flush`

Usage
-----

[](#usage)

Once installation is successfull, invoke `MageStack\PersistentCache\Api\CacheRepositoryInterface` in your class and start using available methods.

Contributing
------------

[](#contributing)

If you would like to contribute to this module, feel free to fork the repository and create a pull request. Please make sure to follow the coding standards of Magento 2.

Reporting Issues
----------------

[](#reporting-issues)

If you encounter any issues or need support, please create an issue on the GitHub Issues page. We will review and address your concerns as soon as possible.

License
-------

[](#license)

This module is licensed under the MIT License.

Support
-------

[](#support)

If you find this module useful, consider supporting me By giving this module a star on github

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance44

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

371d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/153972349?v=4)[Amit Biswas](/maintainers/attherateof)[@attherateof](https://github.com/attherateof)

---

Top Contributors

[![attherateof](https://avatars.githubusercontent.com/u/153972349?v=4)](https://github.com/attherateof "attherateof (5 commits)")

### Embed Badge

![Health badge](/badges/mage-stack-module-persistent-cache/health.svg)

```
[![Health](https://phpackages.com/badges/mage-stack-module-persistent-cache/health.svg)](https://phpackages.com/packages/mage-stack-module-persistent-cache)
```

###  Alternatives

[fastly/magento2

Fastly CDN Module for Magento 2.4.x

1564.4M1](/packages/fastly-magento2)[lizardmedia/module-varnish-warmer

Varnish Cache Warmer Magento2 module by Lizard Media

6180.3k](/packages/lizardmedia-module-varnish-warmer)[elgentos/magento2-varnish-extended

This extension extends the built-in Varnish functionalities

6920.7k](/packages/elgentos-magento2-varnish-extended)[litespeed/module-litemage

LiteMage Full Page Cache for LiteSpeed Web Server

3257.9k](/packages/litespeed-module-litemage)[pronko/selective-cache

Pronko Consulting Selective Cache

3520.4k](/packages/pronko-selective-cache)[myparcelnl/magento

A Magento 2 module that creates MyParcel labels

1860.2k](/packages/myparcelnl-magento)

PHPackages © 2026

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