pardnchiu / cache
This package is abandoned and no longer maintained.
No replacement package was suggested.
PD\Cache is a hybrid caching system for PHP that combines Redis and filesystem caching with automatic filesystem fallback support.
1.0.0
2025-02-02 21:04 UTC
Requires
- php: >=8.0
Requires (Dev)
None
Suggests
- pardnchiu/redis: For Redis caching support
Provides
None
Conflicts
None
Replaces
None
README
Last updated: 2026-10-25
Note
This README was generated by SKILL, get the ZH version from here.
REDIS WHEN IT'S UP, FILES WHEN IT'S DOWN!
A PHP cache library with Redis-first storage, automatic filesystem fallback, and built-in HTML minification
Table of Contents
Features
composer require pardnchiu/cache· Documentation
- Redis First, Files as Fallback — Reads and writes go to Redis while it is connected and switch to JSON files under the document root when it is not, so caching never stops.
- Built-in Expiration — File entries store their expiry time and are deleted on read once stale, while Redis entries rely on EXPIRE.
- HTML Minification on Write — Line breaks, indentation, and whitespace between tags are stripped to shrink page caches.
- MD5 Key Normalization — Any page identifier hashes into a fixed-length key, avoiding special-character issues in filenames and key names.
- One-Call Cleanup — A single method scans the cache directory and removes every expired entry, ready for a cron job.
Architecture
graph TB
A[Caller] --> B[PD\Cache]
B --> C{Redis connected?}
C -->|Yes| D[Redis DB 1]
C -->|No| E[storage/caches JSON files]
E --> F[Expiry check / cleanup]
Loading
License
This project is licensed under the MIT LICENSE.
Author
Just open an issue to share an idea.
©️ 2024 邱敬幃 Pardn Chiu