alphavel/cache

Cache package for Alphavel Framework

Maintainers

Package info

github.com/alphavel/cache

pkg:composer/alphavel/cache

Statistics

Installs: 1

Dependents: 0

Suggesters: 1

Stars: 0

Open Issues: 0

v1.0.0 2025-11-26 15:47 UTC

This package is auto-updated.

Last update: 2026-03-27 01:19:54 UTC


README

High-performance cache layer with Redis, File, and Memory drivers

PHP Version License

✨ Features

  • Multiple drivers - Redis, File, Memory
  • 🔄 Remember pattern - Cache with fallback
  • TTL support - Automatic expiration
  • 🎯 Laravel-compatible - Familiar API
  • 🚀 Swoole-optimized - Coroutine-safe

📦 Installation

composer require alphavel/cache

⚙️ Configuration

CACHE_DRIVER=redis

# Redis
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=
REDIS_DATABASE=0

For Docker: use service name (e.g., REDIS_HOST=redis)

🚀 Quick Start

use Cache;

// Set
Cache::set('key', 'value', 3600);

// Get
$value = Cache::get('key');

// Remember pattern
$users = Cache::remember('users', 300, fn() => 
    DB::table('users')->get()
);

// Delete
Cache::delete('key');

// Clear all
Cache::flush();

📚 Documentation

Full documentation: https://github.com/alphavel/documentation

📄 License

MIT License