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

ActiveLibrary[Caching](/categories/caching)

tweekersnut/cache
=================

A high-performance, pluggable PHP caching library with Redis, file, session, and memory drivers.

v1.1.0(5mo ago)08MITPHPPHP &gt;=8.0

Since Oct 18Pushed 5mo agoCompare

[ Source](https://github.com/TaranpreetSinghRayat/cache)[ Packagist](https://packagist.org/packages/tweekersnut/cache)[ RSS](/packages/tweekersnut-cache/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (1)Versions (3)Used By (0)

TweekersNut Cache
=================

[](#tweekersnut-cache)

[![PHP Version](https://camo.githubusercontent.com/f32695bd6f65b12545162e869707d33dac6bcb5f6e5dc0d48b6d1f8162b6c247/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e302d626c75652e737667)](https://php.net)[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](LICENSE)

**A high-performance, pluggable PHP caching library with Redis, file, session, and memory drivers.**

TweekersNut Cache is a professional, production-ready caching solution designed to speed up backend processing, data fetching, and manipulation. It provides a unified interface for multiple cache drivers, making it easy to switch between different caching strategies without changing your code.

---

🚀 Features
----------

[](#-features)

- **Multiple Cache Drivers**: Redis, File, Session, and Array (in-memory)
- **Unified Interface**: Consistent API across all drivers
- **PSR-4 Autoloading**: Modern PHP standards
- **Type-Safe**: Full PHP 8.0+ type hints
- **Zero Dependencies**: No framework required (works standalone)
- **High Performance**: Optimized for production environments
- **TTL Support**: Time-to-live for automatic expiration
- **Prefix/Namespace Support**: Avoid key collisions
- **Remember Pattern**: Cache-or-execute in one call
- **Increment/Decrement**: Atomic counter operations
- **Exception-Safe**: Never breaks application flow

---

📦 Installation
--------------

[](#-installation)

Install via Composer:

```
composer require tweekersnut/cache
```

### Requirements

[](#requirements)

- PHP &gt;= 8.0
- (Optional) Redis extension for Redis driver
- (Optional) Predis library as alternative to Redis extension

---

🎯 Quick Start
-------------

[](#-quick-start)

### Basic Usage

[](#basic-usage)

```
