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

ActiveLibrary[Caching](/categories/caching)

pardnchiu/cache
===============

PD\\Cache is a hybrid caching system for PHP that combines Redis and filesystem caching with automatic filesystem fallback support.

1.0.0(1y ago)08MITPHPPHP &gt;=8.0

Since Feb 2Pushed 1y ago1 watchersCompare

[ Source](https://github.com/pardnchiu/PHP-Cache)[ Packagist](https://packagist.org/packages/pardnchiu/cache)[ RSS](/packages/pardnchiu-cache/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

PD\\Cache
=========

[](#pdcache)

> PD\\Cache is a hybrid caching system for PHP that combines Redis and filesystem caching with automatic filesystem fallback support.

[![tag](https://camo.githubusercontent.com/07d4775f9a428b29d7f341b0104590f95096d5f18eba51e4087d9c4d528f99d7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7461672d5048502532304c6962726172792d626234343434)](https://camo.githubusercontent.com/07d4775f9a428b29d7f341b0104590f95096d5f18eba51e4087d9c4d528f99d7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7461672d5048502532304c6962726172792d626234343434)[![size](https://camo.githubusercontent.com/08375934c1440f0f1d13945863813f799de430f25c03a0619a820db6c7797582/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73697a652f706172646e636869752f5048502d43616368652f7372632f43616368652e706870)](https://camo.githubusercontent.com/08375934c1440f0f1d13945863813f799de430f25c03a0619a820db6c7797582/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73697a652f706172646e636869752f5048502d43616368652f7372632f43616368652e706870)
[![version](https://camo.githubusercontent.com/09088694ff189150ed6ba28db510516df5df3effc5778b01c24bfd39bb15e148/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706172646e636869752f6361636865)](https://camo.githubusercontent.com/09088694ff189150ed6ba28db510516df5df3effc5778b01c24bfd39bb15e148/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706172646e636869752f6361636865)[![download](https://camo.githubusercontent.com/da4ca05aaee50aef66634ac65fb225fcb004cd7bbee1a162436b16dceec79fe0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f706172646e636869752f6361636865)](https://camo.githubusercontent.com/da4ca05aaee50aef66634ac65fb225fcb004cd7bbee1a162436b16dceec79fe0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f706172646e636869752f6361636865)

Features
--------

[](#features)

- Hybrid caching strategy (Redis + Filesystem)
- Automatic fallback to filesystem when Redis is unavailable
- Built-in HTML / Text content optimization
- Automatic cache expiration handling
- Cache cleanup mechanism
- MD5 key generation for cache entries

Key Capabilities
----------------

[](#key-capabilities)

- Get/Set cache with automatic storage selection
- HTML/Text content minification
- Automatic cache expiration
- Cache cleanup for expired entries
- System resilience fallback mechanism

Dependencies
------------

[](#dependencies)

- `pardnchiu/redis` - For Redis caching support (optional)
- `/storage/caches` - Write permission on storage directory

How to Use
----------

[](#how-to-use)

### Installation

[](#installation)

```
composer require pardnchiu/cache
```

```
// Initialize cache with Redis support
$redis = new PD\Redis();
$cache = new PD\Cache($redis);

// Set cache with 1-hour expiration
$cache->set("page-key", $content, 3600);

// Get cached content
$content = $cache->get("page-key");

// Clean expired cache entries
$cache->clean();

// Initialize cache without Redis (filesystem only)
$cache = new PD\Cache();
```

License
-------

[](#license)

This source code project is licensed under the [MIT](https://github.com/pardnchiu/PHP-Cache/blob/main/LICENSE) license.

Creator
-------

[](#creator)

[![](https://avatars.githubusercontent.com/u/25631760)](https://avatars.githubusercontent.com/u/25631760)

#### Pardn Chiu

[](#pardn-chiu)

[ ![](https://camo.githubusercontent.com/e4e01ee8def1b738dccf7d9ae9b80b137ddbfb3620b6cd2252a085691d2aa44b/68747470733a2f2f706172646e2e696f2f696d6167652f656d61696c2e737667)](mailto:dev@pardn.io)[ ![](https://camo.githubusercontent.com/3005d0110354f5144ff35f72d9e23c4df3cedf99365160c6c307236e8fc4d189/68747470733a2f2f706172646e2e696f2f696d6167652f6c696e6b6564696e2e737667)](https://linkedin.com/in/pardnchiu)---

©️ 2024 [Pardn Chiu](https://pardn.io)

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 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

560d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/25631760?v=4)[邱敬幃 Pardn Chiu](/maintainers/pardnchiu)[@pardnchiu](https://github.com/pardnchiu)

---

Top Contributors

[![pardnchiu](https://avatars.githubusercontent.com/u/25631760?v=4)](https://github.com/pardnchiu "pardnchiu (3 commits)")

---

Tags

cachepardnchiuphp-composerphp-library

### Embed Badge

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

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

###  Alternatives

[iazaran/smart-cache

Smart Cache is a caching optimization package designed to enhance the way your Laravel application handles data caching. It intelligently manages large data sets by compressing, chunking, or applying other optimization strategies to keep your application performant and efficient.

21114.2k](/packages/iazaran-smart-cache)[phpfastcache/phpssdb

PHP SSDB Driver for phpFastCache

14736.9k1](/packages/phpfastcache-phpssdb)[rapidwebltd/rw-file-cache

RW File Cache is a PHP File-based Caching Library. Its syntax is designed to closely resemble the PHP memcache extension.

15196.8k7](/packages/rapidwebltd-rw-file-cache)[yuzuru-s/redis-recommend

Wrapping Redis's sorted set APIs for specializing recommending operations.

392.9k](/packages/yuzuru-s-redis-recommend)[ichhabrecht/intcache

Turn uncachable page objects into cacheable links

193.9k](/packages/ichhabrecht-intcache)

PHPackages © 2026

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