Releases: infocyph/CacheLayer
1.2
CacheLayer v1.2
🚀 Major Features
Tiered Caching
Multi-level cache with L1/L2/DB fallback via Cache::tiered(). Supports descriptor-based configuration and automatic promotion.
$cache = Cache::tiered([
['driver' => 'apcu', 'namespace' => 'app'],
['driver' => 'valkey', 'namespace' => 'app', 'dsn' => 'valkey://127.0.0.1:6379'],
], writeToL1: false);Valkey Support
Redis-compatible Cache::valkey() adapter with auto-configured lock provider.
ScyllaDB/Cassandra
New Cache::scyllaDb() adapter with auto-schema creation and prepared statement support.
🔄 Removals
- DynamoDB Adapter → Use ScyllaDB or MongoDB
- S3 Adapter → Use MongoDB or ScyllaDB
- Removed
.github/scripts/and local CI configs (now via phpforge)
📦 Changes
- Extracted
CacheReadRememberTrait,SecuresFilesystemDirectories,AdapterValueNormalizer - Improved lock provider retry logic with shared helpers
- Better code organization and reduced duplication
- Enhanced error handling and type safety
- Updated documentation with tiered cache examples
✅ Backward Compatible
All existing adapters maintain full API compatibility. Only DynamoDB and S3 adapters removed.
Requires: PHP ≥ 8.3
Full Changelog: 1.01...1.2
1.01
1.0
🎉 Initial Release
We're excited to announce the first stable release of CacheLayer, a standalone cache toolkit for modern PHP applications.
CacheLayer was separated from the Intermix project to provide better focus on caching functionality and faster feature development.
✨ Key Features
- Unified API: Implements PSR-6, PSR-16,
ArrayAccess, andCountableinterfaces - Multiple Adapters: Support for APCu, File, PHP Files, Memcached, Redis, Redis Cluster, PDO (SQLite), Shared Memory, MongoDB, DynamoDB, and S3
- Tagged Invalidation: Versioned tag support with
setTagged(),invalidateTag(), andinvalidateTags()methods - Stampede Protection: Safe
remember()method with pluggable lock providers - Metrics & Monitoring: Per-adapter metrics counters and export hooks
- Compression Support: Configurable payload compression
- Serialization Helpers: Value serializer for closures and resources
- Memoization: Helper methods including
memoize(),remember(), andonce()
📋 Requirements
- PHP 8.3 or higher
- Composer
- Optional extensions depending on adapter choice (ext-apcu, ext-redis, ext-memcached, ext-pdo, ext-sysvshm, etc.)
🚀 Quick Start
use Infocyph\CacheLayer\Cache\Cache;
$cache = Cache::pdo('app'); // defaults to sqlite
$cache->setTagged('user:1', ['name' => 'Ada'], ['users'], 300);
$user = $cache->remember('user:1', function ($item) {
$item->expiresAfter(300);
return ['name' => 'Ada'];
}, tags: ['users']);
$cache->invalidateTag('users');📚 Documentation
Full documentation is available at: https://docs.infocyph.com/projects/CacheLayer
🛠 Installation
composer require infocyph/cachelayer📄 License
MIT License - See LICENSE for details.
Thanks for using CacheLayer! Please report issues and share your feedback on GitHub.